Skip to content

Commit

Permalink
Input: opencores-kbd - convert to devm_platform_ioremap_resource()
Browse files Browse the repository at this point in the history
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
bbkzz authored and dtor committed Jul 11, 2023
1 parent e796377 commit db98422
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/input/keyboard/opencores-kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,8 @@ static int opencores_kbd_probe(struct platform_device *pdev)
{
struct input_dev *input;
struct opencores_kbd *opencores_kbd;
struct resource *res;
int irq, i, error;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "missing board memory resource\n");
return -EINVAL;
}

irq = platform_get_irq(pdev, 0);
if (irq < 0)
return -EINVAL;
Expand All @@ -65,7 +58,7 @@ static int opencores_kbd_probe(struct platform_device *pdev)

opencores_kbd->input = input;

opencores_kbd->addr = devm_ioremap_resource(&pdev->dev, res);
opencores_kbd->addr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(opencores_kbd->addr))
return PTR_ERR(opencores_kbd->addr);

Expand Down

0 comments on commit db98422

Please sign in to comment.