2014-06-11 08:16:22

by Dan Carpenter

[permalink] [raw]
Subject: [patch] pinctrl: berlin: fix an error code in berlin_pinctrl_probe()

We are returning success here because PTR_ERR(NULL) is zero. We should
be returning -ENODEV.

Fixes: 3de68d331c24 ('pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs')
Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index edf5d2f..86db223 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,

regmap = dev_get_regmap(&pdev->dev, NULL);
if (!regmap)
- return PTR_ERR(regmap);
+ return -ENODEV;

pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
if (!pctrl)


2014-06-11 08:36:28

by Sebastian Hesselbarth

[permalink] [raw]
Subject: Re: [patch] pinctrl: berlin: fix an error code in berlin_pinctrl_probe()

On 06/11/2014 10:15 AM, Dan Carpenter wrote:
> We are returning success here because PTR_ERR(NULL) is zero. We should
> be returning -ENODEV.
>
> Fixes: 3de68d331c24 ('pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs')
> Signed-off-by: Dan Carpenter <[email protected]>

Dan, thanks for the fix!

Acked-by: Sebastian Hesselbarth <[email protected]>

> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index edf5d2f..86db223 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c
> @@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
>
> regmap = dev_get_regmap(&pdev->dev, NULL);
> if (!regmap)
> - return PTR_ERR(regmap);
> + return -ENODEV;
>
> pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
> if (!pctrl)
>

2014-07-04 23:16:26

by Linus Walleij

[permalink] [raw]
Subject: Re: [patch] pinctrl: berlin: fix an error code in berlin_pinctrl_probe()

On Wed, Jun 11, 2014 at 10:15 AM, Dan Carpenter
<[email protected]> wrote:

> We are returning success here because PTR_ERR(NULL) is zero. We should
> be returning -ENODEV.
>
> Fixes: 3de68d331c24 ('pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs')
> Signed-off-by: Dan Carpenter <[email protected]>

Patch applied for fixes!

Yours,
Linus Walleij