Skip to content

Commit

Permalink
Input: apbps2 - convert to devm_ioremap_resource()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Dmitry Torokhov committed Apr 15, 2013
1 parent 39fbe58 commit e07a894
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/input/serio/apbps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e07a894

Please sign in to comment.