Skip to content

Commit

Permalink
Input: tegra-kbc - 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>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Sachin Kamat authored and Dmitry Torokhov committed Mar 18, 2013
1 parent 688d794 commit ba52a7f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/input/keyboard/tegra-kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/slab.h>
#include <linux/input/matrix_keypad.h>
#include <linux/clk/tegra.h>
#include <linux/err.h>

#define KBC_MAX_GPIO 24
#define KBC_MAX_KPENT 8
Expand Down Expand Up @@ -608,11 +609,9 @@ static int tegra_kbc_probe(struct platform_device *pdev)

setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc);

kbc->mmio = devm_request_and_ioremap(&pdev->dev, res);
if (!kbc->mmio) {
dev_err(&pdev->dev, "Cannot request memregion/iomap address\n");
return -EBUSY;
}
kbc->mmio = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(kbc->mmio))
return PTR_ERR(kbc->mmio);

kbc->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(kbc->clk)) {
Expand Down

0 comments on commit ba52a7f

Please sign in to comment.