All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()
@ 2013-06-28 10:33 Axel Lin
  2013-06-28 10:36 ` Srinivas KANDAGATLA
  0 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2013-06-28 10:33 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Srinivas KANDAGATLA, linux-kernel

syscon_regmap_lookup_by_phandle() returns ERR_PTR on error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pinctrl/pinctrl-st.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 7effedf..f95c82a 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -1299,9 +1299,9 @@ static int st_pctl_probe_dt(struct platform_device *pdev,
 		return -ENOMEM;
 
 	info->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
-	if (!info->regmap) {
+	if (IS_ERR(info->regmap)) {
 		dev_err(info->dev, "No syscfg phandle specified\n");
-		return -ENOMEM;
+		return PTR_ERR(info->regmap);
 	}
 	info->data = of_match_node(st_pctl_of_match, np)->data;
 
-- 
1.8.1.2




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

* Re: [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()
  2013-06-28 10:33 [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle() Axel Lin
@ 2013-06-28 10:36 ` Srinivas KANDAGATLA
  2013-06-28 12:16   ` Axel Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Srinivas KANDAGATLA @ 2013-06-28 10:36 UTC (permalink / raw)
  To: Axel Lin; +Cc: Linus Walleij, linux-kernel

Thankyou Axel for looking at this.

There is already a patch is submitted for this.
https://lkml.org/lkml/2013/6/26/494 which I have Acked.

Thanks,
srini
On 28/06/13 11:33, Axel Lin wrote:
> syscon_regmap_lookup_by_phandle() returns ERR_PTR on error.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/pinctrl/pinctrl-st.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
> index 7effedf..f95c82a 100644
> --- a/drivers/pinctrl/pinctrl-st.c
> +++ b/drivers/pinctrl/pinctrl-st.c
> @@ -1299,9 +1299,9 @@ static int st_pctl_probe_dt(struct platform_device *pdev,
>  		return -ENOMEM;
>  
>  	info->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
> -	if (!info->regmap) {
> +	if (IS_ERR(info->regmap)) {
>  		dev_err(info->dev, "No syscfg phandle specified\n");
> -		return -ENOMEM;
> +		return PTR_ERR(info->regmap);
>  	}
>  	info->data = of_match_node(st_pctl_of_match, np)->data;
>  
> 


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

* Re: [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()
  2013-06-28 10:36 ` Srinivas KANDAGATLA
@ 2013-06-28 12:16   ` Axel Lin
  2013-06-28 13:56     ` Srinivas KANDAGATLA
  0 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2013-06-28 12:16 UTC (permalink / raw)
  To: srinivas.kandagatla; +Cc: Linus Walleij, linux-kernel

2013/6/28 Srinivas KANDAGATLA <srinivas.kandagatla@st.com>:
> Thankyou Axel for looking at this.
>
> There is already a patch is submitted for this.
> https://lkml.org/lkml/2013/6/26/494 which I have Acked.

That is strange.
I don't think the patch you mentioned can be applied to current pinctrl tree.
Current code does check pinctrl_register by IS_ERR.

        info->pctl = pinctrl_register(pctl_desc, &pdev->dev, info);
        if (IS_ERR(info->pctl)) {

Regards,
Axel

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

* Re: [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()
  2013-06-28 12:16   ` Axel Lin
@ 2013-06-28 13:56     ` Srinivas KANDAGATLA
  2013-06-28 14:24       ` Axel Lin
  0 siblings, 1 reply; 5+ messages in thread
From: Srinivas KANDAGATLA @ 2013-06-28 13:56 UTC (permalink / raw)
  To: Axel Lin; +Cc: Linus Walleij, linux-kernel

On 28/06/13 13:16, Axel Lin wrote:
> 2013/6/28 Srinivas KANDAGATLA <srinivas.kandagatla@st.com>:
>> Thankyou Axel for looking at this.
>>
>> There is already a patch is submitted for this.
>> https://lkml.org/lkml/2013/6/26/494 which I have Acked.
> 
> That is strange.
> I don't think the patch you mentioned can be applied to current pinctrl tree.
> Current code does check pinctrl_register by IS_ERR.
The patch removes the IS_ERR, because, pinctrl_register returns NULL or
a valid pointer, using IS_ERR is this case is incorrect.

Thanks,
srini
> 
>         info->pctl = pinctrl_register(pctl_desc, &pdev->dev, info);
>         if (IS_ERR(info->pctl)) {

> 
> Regards,
> Axel
> 


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

* Re: [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle()
  2013-06-28 13:56     ` Srinivas KANDAGATLA
@ 2013-06-28 14:24       ` Axel Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Axel Lin @ 2013-06-28 14:24 UTC (permalink / raw)
  To: srinivas.kandagatla; +Cc: Linus Walleij, linux-kernel

2013/6/28 Srinivas KANDAGATLA <srinivas.kandagatla@st.com>:
> On 28/06/13 13:16, Axel Lin wrote:
>> 2013/6/28 Srinivas KANDAGATLA <srinivas.kandagatla@st.com>:
>>> Thankyou Axel for looking at this.
>>>
>>> There is already a patch is submitted for this.
>>> https://lkml.org/lkml/2013/6/26/494 which I have Acked.
>>
>> That is strange.
>> I don't think the patch you mentioned can be applied to current pinctrl tree.
>> Current code does check pinctrl_register by IS_ERR.
> The patch removes the IS_ERR, because, pinctrl_register returns NULL or
> a valid pointer, using IS_ERR is this case is incorrect.
You are right.

Thanks,
Axel

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

end of thread, other threads:[~2013-06-28 14:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 10:33 [PATCH] pinctrl: st: Fix checking return value of syscon_regmap_lookup_by_phandle() Axel Lin
2013-06-28 10:36 ` Srinivas KANDAGATLA
2013-06-28 12:16   ` Axel Lin
2013-06-28 13:56     ` Srinivas KANDAGATLA
2013-06-28 14:24       ` Axel Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.