Skip to content

Commit 198a2cc

Browse files
bbkzzdtor
authored andcommitted
Input: pxa27x_keypad - 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-6-frank.li@vivo.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent db98422 commit 198a2cc

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

drivers/input/keyboard/pxa27x_keypad.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
717717
struct device_node *np = pdev->dev.of_node;
718718
struct pxa27x_keypad *keypad;
719719
struct input_dev *input_dev;
720-
struct resource *res;
721720
int irq, error;
722721

723722
/* Driver need build keycode from device tree or pdata */
@@ -728,12 +727,6 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
728727
if (irq < 0)
729728
return -ENXIO;
730729

731-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
732-
if (res == NULL) {
733-
dev_err(&pdev->dev, "failed to get I/O memory\n");
734-
return -ENXIO;
735-
}
736-
737730
keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad),
738731
GFP_KERNEL);
739732
if (!keypad)
@@ -747,7 +740,7 @@ static int pxa27x_keypad_probe(struct platform_device *pdev)
747740
keypad->input_dev = input_dev;
748741
keypad->irq = irq;
749742

750-
keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
743+
keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0);
751744
if (IS_ERR(keypad->mmio_base))
752745
return PTR_ERR(keypad->mmio_base);
753746

0 commit comments

Comments
 (0)