Skip to content

Commit 28e26e9

Browse files
Lv Ruyidtor
authored andcommitted
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 <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Link: https://lore.kernel.org/r/20220418015036.2556731-1-lv.ruyi@zte.com.cn Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 4165751 commit 28e26e9

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/input/keyboard/ep93xx_keypad.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
231231
struct ep93xx_keypad *keypad;
232232
const struct matrix_keymap_data *keymap_data;
233233
struct input_dev *input_dev;
234-
struct resource *res;
235234
int err;
236235

237236
keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL);
@@ -250,11 +249,7 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
250249
if (keypad->irq < 0)
251250
return keypad->irq;
252251

253-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
254-
if (!res)
255-
return -ENXIO;
256-
257-
keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
252+
keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0);
258253
if (IS_ERR(keypad->mmio_base))
259254
return PTR_ERR(keypad->mmio_base);
260255

0 commit comments

Comments
 (0)