summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/ralink
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2020-12-13 17:17:19 +0100
committerLinus Walleij <linus.walleij@linaro.org>2021-01-04 15:38:34 +0100
commit8a55d64c3336fc2ffd488a37d08ceab154c7b56b (patch)
treee8af9401cc1ca523111c985ac2a39cad45f7bdda /drivers/pinctrl/ralink
parent420cf17d975d93973ba80807ea49760ba14feaa9 (diff)
pinctrl: ralink: rt2880: preserve error codes
Some paths in probe function are returning '-EINVAL' instead of preserve original code from called functions. Change them to preserve all of them. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20201213161721.6514-7-sergio.paracuellos@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/ralink')
-rw-r--r--drivers/pinctrl/ralink/pinctrl-rt2880.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c
index 4725aa34328a..273744245861 100644
--- a/drivers/pinctrl/ralink/pinctrl-rt2880.c
+++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c
@@ -315,6 +315,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev)
{
struct rt2880_priv *p;
struct pinctrl_dev *dev;
+ int err;
if (!rt2880_pinmux_data)
return -ENOTSUPP;
@@ -330,13 +331,16 @@ static int rt2880_pinmux_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, p);
/* init the device */
- if (rt2880_pinmux_index(p)) {
+ err = rt2880_pinmux_index(p);
+ if (err) {
dev_err(&pdev->dev, "failed to load index\n");
- return -EINVAL;
+ return err;
}
- if (rt2880_pinmux_pins(p)) {
+
+ err = rt2880_pinmux_pins(p);
+ if (err) {
dev_err(&pdev->dev, "failed to load pins\n");
- return -EINVAL;
+ return err;
}
dev = pinctrl_register(p->desc, &pdev->dev, p);
if (IS_ERR(dev))