Commit 8ec136d0f3d6376ce347255fb3d29708f28cc00a

Authored by Wolfram Sang
Committed by Linus Walleij
1 parent 4fdf774fc9

drivers/pinctrl/spear: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Showing 1 changed file with 1 additions and 6 deletions Side-by-side Diff

drivers/pinctrl/spear/pinctrl-plgpio.c
... ... @@ -528,18 +528,13 @@
528 528 struct resource *res;
529 529 int ret, irq, i;
530 530  
531   - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
532   - if (!res) {
533   - dev_err(&pdev->dev, "invalid IORESOURCE_MEM\n");
534   - return -EBUSY;
535   - }
536   -
537 531 plgpio = devm_kzalloc(&pdev->dev, sizeof(*plgpio), GFP_KERNEL);
538 532 if (!plgpio) {
539 533 dev_err(&pdev->dev, "memory allocation fail\n");
540 534 return -ENOMEM;
541 535 }
542 536  
  537 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
543 538 plgpio->base = devm_ioremap_resource(&pdev->dev, res);
544 539 if (IS_ERR(plgpio->base))
545 540 return PTR_ERR(plgpio->base);