Input: apbps2 - convert to devm_ioremap_resource()
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 15 Apr 2013 20:38:07 +0000 (13:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 15 Apr 2013 20:40:33 +0000 (13:40 -0700)
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>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/serio/apbps2.c

index 2c14e6fa64c2caf3c6869071632f1c0def356be5..17e01a807ddc60129b1943a67b89c665789f644f 100644 (file)
@@ -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);