Commit 8a55d64c authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Linus Walleij

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201213161721.6514-7-sergio.paracuellos@gmail.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 420cf17d
...@@ -315,6 +315,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) ...@@ -315,6 +315,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev)
{ {
struct rt2880_priv *p; struct rt2880_priv *p;
struct pinctrl_dev *dev; struct pinctrl_dev *dev;
int err;
if (!rt2880_pinmux_data) if (!rt2880_pinmux_data)
return -ENOTSUPP; return -ENOTSUPP;
...@@ -330,13 +331,16 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) ...@@ -330,13 +331,16 @@ static int rt2880_pinmux_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, p); platform_set_drvdata(pdev, p);
/* init the device */ /* init the device */
if (rt2880_pinmux_index(p)) { err = rt2880_pinmux_index(p);
if (err) {
dev_err(&pdev->dev, "failed to load index\n"); 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"); dev_err(&pdev->dev, "failed to load pins\n");
return -EINVAL; return err;
} }
dev = pinctrl_register(p->desc, &pdev->dev, p); dev = pinctrl_register(p->desc, &pdev->dev, p);
if (IS_ERR(dev)) if (IS_ERR(dev))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment