summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorabdoulaye berthe <berthe.ab@gmail.com>2014-07-12 16:30:13 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-07-22 10:34:12 -0400
commitb4e7c55dabf611cf5cccd1554fec06f72e1c9faf (patch)
tree12c6b87eeddbeda9fb80c3e61dbdd2037778a283 /drivers/pinctrl
parent144ef62645a7725a0a442129a8750baf257e88b9 (diff)
pinctrl: remove all usage of gpio_remove ret val in driver/pinctl
Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/pinctrl-adi2.c9
-rw-r--r--drivers/pinctrl/pinctrl-as3722.c11
-rw-r--r--drivers/pinctrl/pinctrl-baytrail.c5
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c10
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c16
-rw-r--r--drivers/pinctrl/sh-pfc/gpio.c9
-rw-r--r--drivers/pinctrl/spear/pinctrl-plgpio.c3
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sunxi.c3
-rw-r--r--drivers/pinctrl/vt8500/pinctrl-wmt.c9
9 files changed, 20 insertions, 55 deletions
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index 46413e93d850..b092b93c67a1 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -949,7 +949,7 @@ static int adi_gpio_probe(struct platform_device *pdev)
949 struct gpio_port *port; 949 struct gpio_port *port;
950 char pinctrl_devname[DEVNAME_SIZE]; 950 char pinctrl_devname[DEVNAME_SIZE];
951 static int gpio; 951 static int gpio;
952 int ret = 0, ret1; 952 int ret = 0;
953 953
954 pdata = dev->platform_data; 954 pdata = dev->platform_data;
955 if (!pdata) 955 if (!pdata)
@@ -1027,7 +1027,7 @@ static int adi_gpio_probe(struct platform_device *pdev)
1027 return 0; 1027 return 0;
1028 1028
1029out_remove_gpiochip: 1029out_remove_gpiochip:
1030 ret1 = gpiochip_remove(&port->chip); 1030 gpiochip_remove(&port->chip);
1031out_remove_domain: 1031out_remove_domain:
1032 if (port->pint) 1032 if (port->pint)
1033 irq_domain_remove(port->domain); 1033 irq_domain_remove(port->domain);
@@ -1038,12 +1038,11 @@ out_remove_domain:
1038static int adi_gpio_remove(struct platform_device *pdev) 1038static int adi_gpio_remove(struct platform_device *pdev)
1039{ 1039{
1040 struct gpio_port *port = platform_get_drvdata(pdev); 1040 struct gpio_port *port = platform_get_drvdata(pdev);
1041 int ret;
1042 u8 offset; 1041 u8 offset;
1043 1042
1044 list_del(&port->node); 1043 list_del(&port->node);
1045 gpiochip_remove_pin_ranges(&port->chip); 1044 gpiochip_remove_pin_ranges(&port->chip);
1046 ret = gpiochip_remove(&port->chip); 1045 gpiochip_remove(&port->chip);
1047 if (port->pint) { 1046 if (port->pint) {
1048 for (offset = 0; offset < port->width; offset++) 1047 for (offset = 0; offset < port->width; offset++)
1049 irq_dispose_mapping(irq_find_mapping(port->domain, 1048 irq_dispose_mapping(irq_find_mapping(port->domain,
@@ -1051,7 +1050,7 @@ static int adi_gpio_remove(struct platform_device *pdev)
1051 irq_domain_remove(port->domain); 1050 irq_domain_remove(port->domain);
1052 } 1051 }
1053 1052
1054 return ret; 1053 return 0;
1055} 1054}
1056 1055
1057static int adi_pinctrl_probe(struct platform_device *pdev) 1056static int adi_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c
index c862f9c0e9ce..0e4ec91f4d49 100644
--- a/drivers/pinctrl/pinctrl-as3722.c
+++ b/drivers/pinctrl/pinctrl-as3722.c
@@ -565,7 +565,6 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
565{ 565{
566 struct as3722_pctrl_info *as_pci; 566 struct as3722_pctrl_info *as_pci;
567 int ret; 567 int ret;
568 int tret;
569 568
570 as_pci = devm_kzalloc(&pdev->dev, sizeof(*as_pci), GFP_KERNEL); 569 as_pci = devm_kzalloc(&pdev->dev, sizeof(*as_pci), GFP_KERNEL);
571 if (!as_pci) 570 if (!as_pci)
@@ -611,10 +610,7 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
611 return 0; 610 return 0;
612 611
613fail_range_add: 612fail_range_add:
614 tret = gpiochip_remove(&as_pci->gpio_chip); 613 gpiochip_remove(&as_pci->gpio_chip);
615 if (tret < 0)
616 dev_warn(&pdev->dev, "Couldn't remove gpio chip, %d\n", tret);
617
618fail_chip_add: 614fail_chip_add:
619 pinctrl_unregister(as_pci->pctl); 615 pinctrl_unregister(as_pci->pctl);
620 return ret; 616 return ret;
@@ -623,11 +619,8 @@ fail_chip_add:
623static int as3722_pinctrl_remove(struct platform_device *pdev) 619static int as3722_pinctrl_remove(struct platform_device *pdev)
624{ 620{
625 struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev); 621 struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev);
626 int ret;
627 622
628 ret = gpiochip_remove(&as_pci->gpio_chip); 623 gpiochip_remove(&as_pci->gpio_chip);
629 if (ret < 0)
630 return ret;
631 pinctrl_unregister(as_pci->pctl); 624 pinctrl_unregister(as_pci->pctl);
632 return 0; 625 return 0;
633} 626}
diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c
index 701a646a3d10..d8e946992323 100644
--- a/drivers/pinctrl/pinctrl-baytrail.c
+++ b/drivers/pinctrl/pinctrl-baytrail.c
@@ -638,12 +638,9 @@ MODULE_DEVICE_TABLE(acpi, byt_gpio_acpi_match);
638static int byt_gpio_remove(struct platform_device *pdev) 638static int byt_gpio_remove(struct platform_device *pdev)
639{ 639{
640 struct byt_gpio *vg = platform_get_drvdata(pdev); 640 struct byt_gpio *vg = platform_get_drvdata(pdev);
641 int err;
642 641
643 pm_runtime_disable(&pdev->dev); 642 pm_runtime_disable(&pdev->dev);
644 err = gpiochip_remove(&vg->chip); 643 gpiochip_remove(&vg->chip);
645 if (err)
646 dev_warn(&pdev->dev, "failed to remove gpio_chip.\n");
647 644
648 return 0; 645 return 0;
649} 646}
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index d182fdd2e715..29cbbab8c3a6 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -756,8 +756,7 @@ static int __init u300_gpio_probe(struct platform_device *pdev)
756 756
757err_no_range: 757err_no_range:
758err_no_irqchip: 758err_no_irqchip:
759 if (gpiochip_remove(&gpio->chip)) 759 gpiochip_remove(&gpio->chip);
760 dev_err(&pdev->dev, "failed to remove gpio chip\n");
761err_no_chip: 760err_no_chip:
762 clk_disable_unprepare(gpio->clk); 761 clk_disable_unprepare(gpio->clk);
763 dev_err(&pdev->dev, "module ERROR:%d\n", err); 762 dev_err(&pdev->dev, "module ERROR:%d\n", err);
@@ -767,16 +766,11 @@ err_no_chip:
767static int __exit u300_gpio_remove(struct platform_device *pdev) 766static int __exit u300_gpio_remove(struct platform_device *pdev)
768{ 767{
769 struct u300_gpio *gpio = platform_get_drvdata(pdev); 768 struct u300_gpio *gpio = platform_get_drvdata(pdev);
770 int err;
771 769
772 /* Turn off the GPIO block */ 770 /* Turn off the GPIO block */
773 writel(0x00000000U, gpio->base + U300_GPIO_CR); 771 writel(0x00000000U, gpio->base + U300_GPIO_CR);
774 772
775 err = gpiochip_remove(&gpio->chip); 773 gpiochip_remove(&gpio->chip);
776 if (err < 0) {
777 dev_err(gpio->dev, "unable to remove gpiochip: %d\n", err);
778 return err;
779 }
780 clk_disable_unprepare(gpio->clk); 774 clk_disable_unprepare(gpio->clk);
781 return 0; 775 return 0;
782} 776}
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 192aaee8de07..e2e66c8ccf03 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -1492,10 +1492,7 @@ fail:
1492 for (--i, --bank; i >= 0; --i, --bank) { 1492 for (--i, --bank; i >= 0; --i, --bank) {
1493 if (!bank->valid) 1493 if (!bank->valid)
1494 continue; 1494 continue;
1495 1495 gpiochip_remove(&bank->gpio_chip);
1496 if (gpiochip_remove(&bank->gpio_chip))
1497 dev_err(&pdev->dev, "gpio chip %s remove failed\n",
1498 bank->gpio_chip.label);
1499 } 1496 }
1500 return ret; 1497 return ret;
1501} 1498}
@@ -1505,20 +1502,15 @@ static int rockchip_gpiolib_unregister(struct platform_device *pdev,
1505{ 1502{
1506 struct rockchip_pin_ctrl *ctrl = info->ctrl; 1503 struct rockchip_pin_ctrl *ctrl = info->ctrl;
1507 struct rockchip_pin_bank *bank = ctrl->pin_banks; 1504 struct rockchip_pin_bank *bank = ctrl->pin_banks;
1508 int ret = 0;
1509 int i; 1505 int i;
1510 1506
1511 for (i = 0; !ret && i < ctrl->nr_banks; ++i, ++bank) { 1507 for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
1512 if (!bank->valid) 1508 if (!bank->valid)
1513 continue; 1509 continue;
1514 1510 gpiochip_remove(&bank->gpio_chip);
1515 ret = gpiochip_remove(&bank->gpio_chip);
1516 } 1511 }
1517 1512
1518 if (ret) 1513 return 0;
1519 dev_err(&pdev->dev, "gpio chip remove failed\n");
1520
1521 return ret;
1522} 1514}
1523 1515
1524static int rockchip_get_bank_data(struct rockchip_pin_bank *bank, 1516static int rockchip_get_bank_data(struct rockchip_pin_bank *bank,
diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c
index a9288ab01f7b..80f641ee4dea 100644
--- a/drivers/pinctrl/sh-pfc/gpio.c
+++ b/drivers/pinctrl/sh-pfc/gpio.c
@@ -409,11 +409,8 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
409 409
410int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc) 410int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc)
411{ 411{
412 int err; 412 gpiochip_remove(&pfc->gpio->gpio_chip);
413 int ret; 413 gpiochip_remove(&pfc->func->gpio_chip);
414
415 ret = gpiochip_remove(&pfc->gpio->gpio_chip);
416 err = gpiochip_remove(&pfc->func->gpio_chip);
417 414
418 return ret < 0 ? ret : err; 415 return 0;
419} 416}
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 3a20cdc65810..bddb79105d67 100644
--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
@@ -606,8 +606,7 @@ static int plgpio_probe(struct platform_device *pdev)
606 606
607remove_gpiochip: 607remove_gpiochip:
608 dev_info(&pdev->dev, "Remove gpiochip\n"); 608 dev_info(&pdev->dev, "Remove gpiochip\n");
609 if (gpiochip_remove(&plgpio->chip)) 609 gpiochip_remove(&plgpio->chip);
610 dev_err(&pdev->dev, "unable to remove gpiochip\n");
611unprepare_clk: 610unprepare_clk:
612 if (!IS_ERR(plgpio->clk)) 611 if (!IS_ERR(plgpio->clk))
613 clk_unprepare(plgpio->clk); 612 clk_unprepare(plgpio->clk);
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index 47f5e1bc50d0..96ee6bb0fad5 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -983,8 +983,7 @@ int sunxi_pinctrl_init(struct platform_device *pdev,
983clk_error: 983clk_error:
984 clk_disable_unprepare(clk); 984 clk_disable_unprepare(clk);
985gpiochip_error: 985gpiochip_error:
986 if (gpiochip_remove(pctl->chip)) 986 gpiochip_remove(pctl->chip);
987 dev_err(&pdev->dev, "failed to remove gpio chip\n");
988pinctrl_error: 987pinctrl_error:
989 pinctrl_unregister(pctl->pctl_dev); 988 pinctrl_unregister(pctl->pctl_dev);
990 return ret; 989 return ret;
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index 8c976c21eeee..8cea355f9a81 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -615,8 +615,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
615 return 0; 615 return 0;
616 616
617fail_range: 617fail_range:
618 if (gpiochip_remove(&data->gpio_chip)) 618 gpiochip_remove(&data->gpio_chip);
619 dev_err(&pdev->dev, "failed to remove gpio chip\n");
620fail_gpio: 619fail_gpio:
621 pinctrl_unregister(data->pctl_dev); 620 pinctrl_unregister(data->pctl_dev);
622 return err; 621 return err;
@@ -625,12 +624,8 @@ fail_gpio:
625int wmt_pinctrl_remove(struct platform_device *pdev) 624int wmt_pinctrl_remove(struct platform_device *pdev)
626{ 625{
627 struct wmt_pinctrl_data *data = platform_get_drvdata(pdev); 626 struct wmt_pinctrl_data *data = platform_get_drvdata(pdev);
628 int err;
629
630 err = gpiochip_remove(&data->gpio_chip);
631 if (err)
632 dev_err(&pdev->dev, "failed to remove gpio chip\n");
633 627
628 gpiochip_remove(&data->gpio_chip);
634 pinctrl_unregister(data->pctl_dev); 629 pinctrl_unregister(data->pctl_dev);
635 630
636 return 0; 631 return 0;