Commit ba52a7fc authored by Sachin Kamat's avatar Sachin Kamat Committed by Dmitry Torokhov

Input: tegra-kbc - convert to devm_ioremap_resource()

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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 688d794c
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/input/matrix_keypad.h> #include <linux/input/matrix_keypad.h>
#include <linux/clk/tegra.h> #include <linux/clk/tegra.h>
#include <linux/err.h>
#define KBC_MAX_GPIO 24 #define KBC_MAX_GPIO 24
#define KBC_MAX_KPENT 8 #define KBC_MAX_KPENT 8
...@@ -608,11 +609,9 @@ static int tegra_kbc_probe(struct platform_device *pdev) ...@@ -608,11 +609,9 @@ static int tegra_kbc_probe(struct platform_device *pdev)
setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc); setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc);
kbc->mmio = devm_request_and_ioremap(&pdev->dev, res); kbc->mmio = devm_ioremap_resource(&pdev->dev, res);
if (!kbc->mmio) { if (IS_ERR(kbc->mmio))
dev_err(&pdev->dev, "Cannot request memregion/iomap address\n"); return PTR_ERR(kbc->mmio);
return -EBUSY;
}
kbc->clk = devm_clk_get(&pdev->dev, NULL); kbc->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(kbc->clk)) { if (IS_ERR(kbc->clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment