Message ID | 1347624124-27535-1-git-send-email-sachin.kamat@linaro.org |
---|---|
State | Deferred |
Headers | show |
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
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
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);
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(-)