aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLv Ruyi <[email protected]>2022-04-20 14:46:20 -0700
committerDmitry Torokhov <[email protected]>2022-04-24 18:25:03 -0700
commit28e26e927cf4a37fb84fb8fd9893c6a858676b87 (patch)
tree7d9e408792acc4ab30f66b99d82e5507c36d720b
parent41657514c796e1f0a8cf289780aff8f79643b7e5 (diff)
Input: ep93xx_keypad - use devm_platform_ioremap_resource() helper
Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. This makes the code simpler without functional changes. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Lv Ruyi <[email protected]> Acked-by: Alexander Sverdlin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
-rw-r--r--drivers/input/keyboard/ep93xx_keypad.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index 272a4f1c6e81..7a3b0664ab4f 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -231,7 +231,6 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
struct ep93xx_keypad *keypad;
const struct matrix_keymap_data *keymap_data;
struct input_dev *input_dev;
- struct resource *res;
int err;
keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL);
@@ -250,11 +249,7 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
if (keypad->irq < 0)
return keypad->irq;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -ENXIO;
-
- keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
+ keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(keypad->mmio_base))
return PTR_ERR(keypad->mmio_base);