aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2014-09-16 18:05:41 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-09-23 11:51:12 -0400
commit2fcea6cecbc965b4e02a39537d9d939f5251bbbd (patch)
treeccfc3423faa851c6231a26ce428962e2059b5fe4 /drivers/pinctrl
parent88d5e520aa9701eb3e4f46165e02097cc03d363a (diff)
pinctrl: remove remaining users of gpiochip_remove() retval
Some drivers accidentally still use the return value from gpiochip_remove(). Get rid of them so we can simplify this function and get rid of the return value. Cc: 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/nomadik/pinctrl-abx500.c14
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-nomadik.c2
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c9
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos5440.c6
-rw-r--r--drivers/pinctrl/samsung/pinctrl-samsung.c15
-rw-r--r--drivers/pinctrl/sirf/pinctrl-sirf.c3
6 files changed, 10 insertions, 39 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c
index a53a689a2bfa..7df34b70e8b6 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c
@@ -1298,10 +1298,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
1298 return 0; 1298 return 0;
1299 1299
1300out_rem_chip: 1300out_rem_chip:
1301 err = gpiochip_remove(&pct->chip); 1301 gpiochip_remove(&pct->chip);
1302 if (err)
1303 dev_info(&pdev->dev, "failed to remove gpiochip\n");
1304
1305 return ret; 1302 return ret;
1306} 1303}
1307 1304
@@ -1312,15 +1309,8 @@ out_rem_chip:
1312static int abx500_gpio_remove(struct platform_device *pdev) 1309static int abx500_gpio_remove(struct platform_device *pdev)
1313{ 1310{
1314 struct abx500_pinctrl *pct = platform_get_drvdata(pdev); 1311 struct abx500_pinctrl *pct = platform_get_drvdata(pdev);
1315 int ret;
1316
1317 ret = gpiochip_remove(&pct->chip);
1318 if (ret < 0) {
1319 dev_err(pct->dev, "unable to remove gpiochip: %d\n",
1320 ret);
1321 return ret;
1322 }
1323 1312
1313 gpiochip_remove(&pct->chip);
1324 return 0; 1314 return 0;
1325} 1315}
1326 1316
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index e7cab07eef47..4332b38c52ab 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -1261,7 +1261,7 @@ static int nmk_gpio_probe(struct platform_device *dev)
1261 IRQ_TYPE_EDGE_FALLING); 1261 IRQ_TYPE_EDGE_FALLING);
1262 if (ret) { 1262 if (ret) {
1263 dev_err(&dev->dev, "could not add irqchip\n"); 1263 dev_err(&dev->dev, "could not add irqchip\n");
1264 ret = gpiochip_remove(&nmk_chip->chip); 1264 gpiochip_remove(&nmk_chip->chip);
1265 return -ENODEV; 1265 return -ENODEV;
1266 } 1266 }
1267 /* Then register the chain on the parent IRQ */ 1267 /* Then register the chain on the parent IRQ */
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 2738108caff2..041677113a48 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -903,16 +903,9 @@ EXPORT_SYMBOL(msm_pinctrl_probe);
903int msm_pinctrl_remove(struct platform_device *pdev) 903int msm_pinctrl_remove(struct platform_device *pdev)
904{ 904{
905 struct msm_pinctrl *pctrl = platform_get_drvdata(pdev); 905 struct msm_pinctrl *pctrl = platform_get_drvdata(pdev);
906 int ret;
907
908 ret = gpiochip_remove(&pctrl->chip);
909 if (ret) {
910 dev_err(&pdev->dev, "Failed to remove gpiochip\n");
911 return ret;
912 }
913 906
907 gpiochip_remove(&pctrl->chip);
914 pinctrl_unregister(pctrl->pctrl); 908 pinctrl_unregister(pctrl->pctrl);
915
916 return 0; 909 return 0;
917} 910}
918EXPORT_SYMBOL(msm_pinctrl_remove); 911EXPORT_SYMBOL(msm_pinctrl_remove);
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c
index 603da2f9dd95..8ef370244aee 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos5440.c
@@ -873,11 +873,7 @@ static int exynos5440_gpiolib_register(struct platform_device *pdev,
873static int exynos5440_gpiolib_unregister(struct platform_device *pdev, 873static int exynos5440_gpiolib_unregister(struct platform_device *pdev,
874 struct exynos5440_pinctrl_priv_data *priv) 874 struct exynos5440_pinctrl_priv_data *priv)
875{ 875{
876 int ret = gpiochip_remove(priv->gc); 876 gpiochip_remove(priv->gc);
877 if (ret) {
878 dev_err(&pdev->dev, "gpio chip remove failed\n");
879 return ret;
880 }
881 return 0; 877 return 0;
882} 878}
883 879
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index b07406da333c..83faddf456e0 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -945,9 +945,7 @@ static int samsung_gpiolib_register(struct platform_device *pdev,
945 945
946fail: 946fail:
947 for (--i, --bank; i >= 0; --i, --bank) 947 for (--i, --bank; i >= 0; --i, --bank)
948 if (gpiochip_remove(&bank->gpio_chip)) 948 gpiochip_remove(&bank->gpio_chip);
949 dev_err(&pdev->dev, "gpio chip %s remove failed\n",
950 bank->gpio_chip.label);
951 return ret; 949 return ret;
952} 950}
953 951
@@ -957,16 +955,11 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev,
957{ 955{
958 struct samsung_pin_ctrl *ctrl = drvdata->ctrl; 956 struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
959 struct samsung_pin_bank *bank = ctrl->pin_banks; 957 struct samsung_pin_bank *bank = ctrl->pin_banks;
960 int ret = 0;
961 int i; 958 int i;
962 959
963 for (i = 0; !ret && i < ctrl->nr_banks; ++i, ++bank) 960 for (i = 0; i < ctrl->nr_banks; ++i, ++bank)
964 ret = gpiochip_remove(&bank->gpio_chip); 961 gpiochip_remove(&bank->gpio_chip);
965 962 return 0;
966 if (ret)
967 dev_err(&pdev->dev, "gpio chip remove failed\n");
968
969 return ret;
970} 963}
971 964
972static const struct of_device_id samsung_pinctrl_dt_match[]; 965static const struct of_device_id samsung_pinctrl_dt_match[];
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c
index 4c1d7c68666d..25eefdbb76b6 100644
--- a/drivers/pinctrl/sirf/pinctrl-sirf.c
+++ b/drivers/pinctrl/sirf/pinctrl-sirf.c
@@ -877,8 +877,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
877 877
878out_no_range: 878out_no_range:
879out_banks: 879out_banks:
880 if (gpiochip_remove(&sgpio->chip.gc)) 880 gpiochip_remove(&sgpio->chip.gc);
881 dev_err(&pdev->dev, "could not remove gpio chip\n");
882out: 881out:
883 iounmap(regs); 882 iounmap(regs);
884 return err; 883 return err;