linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sachin Kamat <sachin.kamat@linaro.org>
To: linux-input@vger.kernel.org
Cc: dmitry.torokhov@gmail.com, sachin.kamat@linaro.org,
	Daniel Hellstrom <daniel@gaisler.com>
Subject: [PATCH 1/1] Input: apbps2 - Convert to devm_ioremap_resource()
Date: Mon,  8 Apr 2013 14:33:51 +0530	[thread overview]
Message-ID: <1365411831-8021-1-git-send-email-sachin.kamat@linaro.org> (raw)

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 <sachin.kamat@linaro.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
---
 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);
-- 
1.7.9.5


             reply	other threads:[~2013-04-08  9:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08  9:03 Sachin Kamat [this message]
2013-04-15 20:40 ` [PATCH 1/1] Input: apbps2 - Convert to devm_ioremap_resource() Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365411831-8021-1-git-send-email-sachin.kamat@linaro.org \
    --to=sachin.kamat@linaro.org \
    --cc=daniel@gaisler.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).