Skip to content

Commit e796377

Browse files
bbkzzdtor
authored andcommitted
Input: omap4-keyad - convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230705052346.39337-4-frank.li@vivo.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent b1066df commit e796377

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

drivers/input/keyboard/omap4-keypad.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,10 @@ static int omap4_keypad_probe(struct platform_device *pdev)
341341
struct device *dev = &pdev->dev;
342342
struct omap4_keypad *keypad_data;
343343
struct input_dev *input_dev;
344-
struct resource *res;
345344
unsigned int max_keys;
346345
int irq;
347346
int error;
348347

349-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
350-
if (!res) {
351-
dev_err(&pdev->dev, "no base address specified\n");
352-
return -EINVAL;
353-
}
354-
355348
irq = platform_get_irq(pdev, 0);
356349
if (irq < 0)
357350
return irq;
@@ -370,7 +363,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
370363
if (error)
371364
return error;
372365

373-
keypad_data->base = devm_ioremap_resource(dev, res);
366+
keypad_data->base = devm_platform_ioremap_resource(pdev, 0);
374367
if (IS_ERR(keypad_data->base))
375368
return PTR_ERR(keypad_data->base);
376369

0 commit comments

Comments
 (0)