From patchwork Mon Apr 8 09:03:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2405761 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 501CCDFB78 for ; Mon, 8 Apr 2013 09:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934836Ab3DHJPq (ORCPT ); Mon, 8 Apr 2013 05:15:46 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:50900 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934798Ab3DHJPq (ORCPT ); Mon, 8 Apr 2013 05:15:46 -0400 Received: by mail-pa0-f43.google.com with SMTP id hz11so3164442pad.2 for ; Mon, 08 Apr 2013 02:15:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=nY+T0HtVWNuDDuT4aRnmO/HmA4lWyJGhNMI6bdElUXQ=; b=kh5QYNtoM7Z6S06PDdkHno0Tu8ow9Y9TLjorjl6NGhzRSQILnzwN1YjzEvzQ9fpg3d lG1C2GOPvXlMTCuvMFz9pniQ+ejyPsZ00Zk8dhACxfOlef+V7qqm/g5ZtkFpbGGlb/KS 9nhul33ohAe4xfWh6EGxMYa02NApabcvYGKeYZVFtYIk5JTOESPQKHmk01zgU7PaR0Fy GPm7RAgOw1Vw9zIuoNLC4Z15/11ZLMnFA8ehZdBBRAECdaPZlSe2CUxHcpNW8LmMzOVK 5uReJOuz4h6s0s8J2OJ2mSJNaAC/WIH0PTS8jOHNu6ewL2rratw5K+oFvWv/EE7rGiGP OLwg== X-Received: by 10.66.156.68 with SMTP id wc4mr35199212pab.58.1365412545622; Mon, 08 Apr 2013 02:15:45 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id u9sm37940703paf.22.2013.04.08.02.15.42 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 02:15:44 -0700 (PDT) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, sachin.kamat@linaro.org, Daniel Hellstrom Subject: [PATCH 1/1] Input: apbps2 - Convert to devm_ioremap_resource() Date: Mon, 8 Apr 2013 14:33:51 +0530 Message-Id: <1365411831-8021-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlge8wEZeZmmT2I8KF8rlAYn7eR1yu4ja8U4b1edQmrKVQt7PbgAy5M37A/jEtLNMP2pLWx Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() which provides more consistent error handling. devm_ioremap_resource() provides its own error messages; so all explicit error messages can be removed from the failure code paths. Signed-off-by: Sachin Kamat Cc: Daniel Hellstrom --- drivers/input/serio/apbps2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c index 2c14e6f..17e01a8 100644 --- a/drivers/input/serio/apbps2.c +++ b/drivers/input/serio/apbps2.c @@ -147,11 +147,9 @@ static int apbps2_of_probe(struct platform_device *ofdev) /* Find Device Address */ res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); - priv->regs = devm_request_and_ioremap(&ofdev->dev, res); - if (!priv->regs) { - dev_err(&ofdev->dev, "io-regs mapping failed\n"); - return -EBUSY; - } + priv->regs = devm_ioremap_resource(&ofdev->dev, res); + if (IS_ERR(priv->regs)) + return PTR_ERR(priv->regs); /* Reset hardware, disable interrupt */ iowrite32be(0, &priv->regs->ctrl);