linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] pinctrl: Samsung: Fix return value
@ 2012-09-14 12:02 Sachin Kamat
  2012-09-14 14:07 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Sachin Kamat @ 2012-09-14 12:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: linus.walleij, sachin.kamat, patches, Thomas Abraham

Return the value obtained from of_property_count_strings()
instead of -EINVAL.

Silences the following smatch warning:
drivers/pinctrl/pinctrl-samsung.c:529 samsung_pinctrl_parse_dt_pins()
info: why not propagate '*npins' from of_property_count_strings()
instead of -22?

Cc: Thomas Abraham <thomas.ab@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/pinctrl/pinctrl-samsung.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index 8a24223..824fda9 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -526,7 +526,7 @@ static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
 	*npins = of_property_count_strings(cfg_np, "samsung,pins");
 	if (*npins < 0) {
 		dev_err(dev, "invalid pin list in %s node", cfg_np->name);
-		return -EINVAL;
+		return *npins;
 	}
 
 	*pin_list = devm_kzalloc(dev, *npins * sizeof(**pin_list), GFP_KERNEL);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] pinctrl: Samsung: Fix return value
  2012-09-14 12:02 [PATCH 1/1] pinctrl: Samsung: Fix return value Sachin Kamat
@ 2012-09-14 14:07 ` Linus Walleij
  2012-09-26  5:53   ` Sachin Kamat
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2012-09-14 14:07 UTC (permalink / raw)
  To: Sachin Kamat, Thomas Abraham; +Cc: linux-kernel, patches

On Fri, Sep 14, 2012 at 2:02 PM, Sachin Kamat <sachin.kamat@linaro.org> wrote:

> Return the value obtained from of_property_count_strings()
> instead of -EINVAL.
>
> Silences the following smatch warning:
> drivers/pinctrl/pinctrl-samsung.c:529 samsung_pinctrl_parse_dt_pins()
> info: why not propagate '*npins' from of_property_count_strings()
> instead of -22?
>
> Cc: Thomas Abraham <thomas.ab@samsung.com>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/pinctrl/pinctrl-samsung.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
> index 8a24223..824fda9 100644
> --- a/drivers/pinctrl/pinctrl-samsung.c
> +++ b/drivers/pinctrl/pinctrl-samsung.c
> @@ -526,7 +526,7 @@ static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
>         *npins = of_property_count_strings(cfg_np, "samsung,pins");
>         if (*npins < 0) {
>                 dev_err(dev, "invalid pin list in %s node", cfg_np->name);
> -               return -EINVAL;
> +               return *npins;
>         }

Thomas, please check this ...

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] pinctrl: Samsung: Fix return value
  2012-09-14 14:07 ` Linus Walleij
@ 2012-09-26  5:53   ` Sachin Kamat
  0 siblings, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2012-09-26  5:53 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Thomas Abraham, linux-kernel, patches

Hi Thomas,

Please provide your review comments.

On 14 September 2012 19:37, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Sep 14, 2012 at 2:02 PM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>
>> Return the value obtained from of_property_count_strings()
>> instead of -EINVAL.
>>
>> Silences the following smatch warning:
>> drivers/pinctrl/pinctrl-samsung.c:529 samsung_pinctrl_parse_dt_pins()
>> info: why not propagate '*npins' from of_property_count_strings()
>> instead of -22?
>>
>> Cc: Thomas Abraham <thomas.ab@samsung.com>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>>  drivers/pinctrl/pinctrl-samsung.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
>> index 8a24223..824fda9 100644
>> --- a/drivers/pinctrl/pinctrl-samsung.c
>> +++ b/drivers/pinctrl/pinctrl-samsung.c
>> @@ -526,7 +526,7 @@ static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
>>         *npins = of_property_count_strings(cfg_np, "samsung,pins");
>>         if (*npins < 0) {
>>                 dev_err(dev, "invalid pin list in %s node", cfg_np->name);
>> -               return -EINVAL;
>> +               return *npins;
>>         }
>
> Thomas, please check this ...
>
> Yours,
> Linus Walleij



-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-26  5:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-14 12:02 [PATCH 1/1] pinctrl: Samsung: Fix return value Sachin Kamat
2012-09-14 14:07 ` Linus Walleij
2012-09-26  5:53   ` Sachin Kamat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).