diff mbox

[1/1] Input: apbps2 - Convert to devm_ioremap_resource()

Message ID 1365411831-8021-1-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sachin Kamat April 8, 2013, 9:03 a.m. UTC
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(-)

Comments

Dmitry Torokhov April 15, 2013, 8:40 p.m. UTC | #1
On Mon, Apr 08, 2013 at 02:33:51PM +0530, Sachin Kamat wrote:
> 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>

Applied, thank you.
diff mbox

Patch

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);