* [PATCH 2/3] Input: tegra-kbc- Convert to devm_ioremap_resource()
[not found] <1359627939-2685-1-git-send-email-sachin.kamat@linaro.org>
@ 2013-01-31 10:25 ` Sachin Kamat
0 siblings, 0 replies; only message in thread
From: Sachin Kamat @ 2013-01-31 10:25 UTC (permalink / raw)
To: linux-kernel
Cc: thierry.reding, gregkh, sachin.kamat, Dmitry Torokhov,
linux-input
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
---
Compile tested with linux-next (20130128)
---
drivers/input/keyboard/tegra-kbc.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 46e8ad2..016d931 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -31,6 +31,7 @@
#include <linux/slab.h>
#include <linux/input/tegra_kbc.h>
#include <linux/clk/tegra.h>
+#include <linux/err.h>
#define KBC_MAX_DEBOUNCE_CNT 0x3ffu
@@ -615,10 +616,10 @@ static int tegra_kbc_probe(struct platform_device *pdev)
spin_lock_init(&kbc->lock);
setup_timer(&kbc->timer, tegra_kbc_keypress_timer, (unsigned long)kbc);
- kbc->mmio = devm_request_and_ioremap(&pdev->dev, res);
- if (!kbc->mmio) {
+ kbc->mmio = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(kbc->mmio)) {
dev_err(&pdev->dev, "Cannot request memregion/iomap address\n");
- return -EBUSY;
+ return PTR_ERR(kbc->mmio);
}
kbc->clk = devm_clk_get(&pdev->dev, NULL);
--
1.7.4.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-31 10:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1359627939-2685-1-git-send-email-sachin.kamat@linaro.org>
2013-01-31 10:25 ` [PATCH 2/3] Input: tegra-kbc- Convert to devm_ioremap_resource() Sachin Kamat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).