Skip to content

Commit 2fcea6c

Browse files
author
Linus Walleij
committed
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>
1 parent 88d5e52 commit 2fcea6c

6 files changed

Lines changed: 10 additions & 39 deletions

File tree

‎drivers/pinctrl/nomadik/pinctrl-abx500.c‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,10 +1298,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
12981298
return 0;
12991299

13001300
out_rem_chip:
1301-
err = gpiochip_remove(&pct->chip);
1302-
if (err)
1303-
dev_info(&pdev->dev, "failed to remove gpiochip\n");
1304-
1301+
gpiochip_remove(&pct->chip);
13051302
return ret;
13061303
}
13071304

@@ -1312,15 +1309,8 @@ static int abx500_gpio_probe(struct platform_device *pdev)
13121309
static int abx500_gpio_remove(struct platform_device *pdev)
13131310
{
13141311
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-
}
13231312

1313+
gpiochip_remove(&pct->chip);
13241314
return 0;
13251315
}
13261316

‎drivers/pinctrl/nomadik/pinctrl-nomadik.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ static int nmk_gpio_probe(struct platform_device *dev)
12611261
IRQ_TYPE_EDGE_FALLING);
12621262
if (ret) {
12631263
dev_err(&dev->dev, "could not add irqchip\n");
1264-
ret = gpiochip_remove(&nmk_chip->chip);
1264+
gpiochip_remove(&nmk_chip->chip);
12651265
return -ENODEV;
12661266
}
12671267
/* Then register the chain on the parent IRQ */

‎drivers/pinctrl/qcom/pinctrl-msm.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -903,16 +903,9 @@ EXPORT_SYMBOL(msm_pinctrl_probe);
903903
int msm_pinctrl_remove(struct platform_device *pdev)
904904
{
905905
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-
}
913906

907+
gpiochip_remove(&pctrl->chip);
914908
pinctrl_unregister(pctrl->pctrl);
915-
916909
return 0;
917910
}
918911
EXPORT_SYMBOL(msm_pinctrl_remove);

‎drivers/pinctrl/samsung/pinctrl-exynos5440.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -873,11 +873,7 @@ static int exynos5440_gpiolib_register(struct platform_device *pdev,
873873
static int exynos5440_gpiolib_unregister(struct platform_device *pdev,
874874
struct exynos5440_pinctrl_priv_data *priv)
875875
{
876-
int ret = gpiochip_remove(priv->gc);
877-
if (ret) {
878-
dev_err(&pdev->dev, "gpio chip remove failed\n");
879-
return ret;
880-
}
876+
gpiochip_remove(priv->gc);
881877
return 0;
882878
}
883879

‎drivers/pinctrl/samsung/pinctrl-samsung.c‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -945,9 +945,7 @@ static int samsung_gpiolib_register(struct platform_device *pdev,
945945

946946
fail:
947947
for (--i, --bank; i >= 0; --i, --bank)
948-
if (gpiochip_remove(&bank->gpio_chip))
949-
dev_err(&pdev->dev, "gpio chip %s remove failed\n",
950-
bank->gpio_chip.label);
948+
gpiochip_remove(&bank->gpio_chip);
951949
return ret;
952950
}
953951

@@ -957,16 +955,11 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev,
957955
{
958956
struct samsung_pin_ctrl *ctrl = drvdata->ctrl;
959957
struct samsung_pin_bank *bank = ctrl->pin_banks;
960-
int ret = 0;
961958
int i;
962959

963-
for (i = 0; !ret && i < ctrl->nr_banks; ++i, ++bank)
964-
ret = gpiochip_remove(&bank->gpio_chip);
965-
966-
if (ret)
967-
dev_err(&pdev->dev, "gpio chip remove failed\n");
968-
969-
return ret;
960+
for (i = 0; i < ctrl->nr_banks; ++i, ++bank)
961+
gpiochip_remove(&bank->gpio_chip);
962+
return 0;
970963
}
971964

972965
static const struct of_device_id samsung_pinctrl_dt_match[];

‎drivers/pinctrl/sirf/pinctrl-sirf.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,7 @@ static int sirfsoc_gpio_probe(struct device_node *np)
877877

878878
out_no_range:
879879
out_banks:
880-
if (gpiochip_remove(&sgpio->chip.gc))
881-
dev_err(&pdev->dev, "could not remove gpio chip\n");
880+
gpiochip_remove(&sgpio->chip.gc);
882881
out:
883882
iounmap(regs);
884883
return err;

0 commit comments

Comments
 (0)