aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/spear/pinctrl-plgpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/spear/pinctrl-plgpio.c')
-rw-r--r--drivers/pinctrl/spear/pinctrl-plgpio.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 3e5a887216b8..0a7f0bdbaa7d 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -441,7 +441,7 @@ static int spear310_p2o(int pin)
441 return offset; 441 return offset;
442} 442}
443 443
444int spear310_o2p(int offset) 444static int spear310_o2p(int offset)
445{ 445{
446 if (offset <= 3) 446 if (offset <= 3)
447 return 101 - offset; 447 return 101 - offset;
@@ -528,18 +528,13 @@ static int plgpio_probe(struct platform_device *pdev)
528 struct resource *res; 528 struct resource *res;
529 int ret, irq, i; 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 plgpio = devm_kzalloc(&pdev->dev, sizeof(*plgpio), GFP_KERNEL); 531 plgpio = devm_kzalloc(&pdev->dev, sizeof(*plgpio), GFP_KERNEL);
538 if (!plgpio) { 532 if (!plgpio) {
539 dev_err(&pdev->dev, "memory allocation fail\n"); 533 dev_err(&pdev->dev, "memory allocation fail\n");
540 return -ENOMEM; 534 return -ENOMEM;
541 } 535 }
542 536
537 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
543 plgpio->base = devm_ioremap_resource(&pdev->dev, res); 538 plgpio->base = devm_ioremap_resource(&pdev->dev, res);
544 if (IS_ERR(plgpio->base)) 539 if (IS_ERR(plgpio->base))
545 return PTR_ERR(plgpio->base); 540 return PTR_ERR(plgpio->base);