Skip to content

Commit 8d1cbc9

Browse files
Thierry Redinggregkh
authored andcommitted
Input: Convert to devm_ioremap_resource()
Convert all uses of devm_request_and_ioremap() to the newly introduced devm_ioremap_resource() 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: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5fd9846 commit 8d1cbc9

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎drivers/input/keyboard/spear-keyboard.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,9 @@ static int spear_kbd_probe(struct platform_device *pdev)
228228
kbd->suspended_rate = pdata->suspended_rate;
229229
}
230230

231-
kbd->io_base = devm_request_and_ioremap(&pdev->dev, res);
232-
if (!kbd->io_base) {
233-
dev_err(&pdev->dev, "request-ioremap failed for kbd_region\n");
234-
return -ENOMEM;
235-
}
231+
kbd->io_base = devm_ioremap_resource(&pdev->dev, res);
232+
if (IS_ERR(kbd->io_base))
233+
return PTR_ERR(kbd->io_base);
236234

237235
kbd->clk = devm_clk_get(&pdev->dev, NULL);
238236
if (IS_ERR(kbd->clk))

‎drivers/input/serio/arc_ps2.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Driver is originally developed by Pavel Sokolov <psokolov@synopsys.com>
99
*/
1010

11+
#include <linux/err.h>
1112
#include <linux/module.h>
1213
#include <linux/interrupt.h>
1314
#include <linux/input.h>
@@ -206,9 +207,9 @@ static int arc_ps2_probe(struct platform_device *pdev)
206207
return -ENOMEM;
207208
}
208209

209-
arc_ps2->addr = devm_request_and_ioremap(&pdev->dev, res);
210-
if (!arc_ps2->addr)
211-
return -EBUSY;
210+
arc_ps2->addr = devm_ioremap_resource(&pdev->dev, res);
211+
if (IS_ERR(arc_ps2->addr))
212+
return PTR_ERR(arc_ps2->addr);
212213

213214
dev_info(&pdev->dev, "irq = %d, address = 0x%p, ports = %i\n",
214215
irq, arc_ps2->addr, ARC_PS2_PORTS);

0 commit comments

Comments
 (0)