* [PATCH 0/2] convert null test to IS_ERR test
@ 2015-08-24 21:12 Julia Lawall
2015-08-24 21:12 ` [PATCH 1/2] pinctrl: qcom: ssbi: " Julia Lawall
2015-08-24 21:12 ` [PATCH 2/2] pinctrl: digicolor: " Julia Lawall
0 siblings, 2 replies; 6+ messages in thread
From: Julia Lawall @ 2015-08-24 21:12 UTC (permalink / raw)
To: linux-arm-kernel
Since commit 323de9efdf3e ("pinctrl: make pinctrl_register() return proper
error code"), pinctrl_register returns an error code rather than NULL on
failure. Most drivers were updated at that time. Update some drivers that
were introduced more recently.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] pinctrl: qcom: ssbi: convert null test to IS_ERR test
2015-08-24 21:12 [PATCH 0/2] convert null test to IS_ERR test Julia Lawall
@ 2015-08-24 21:12 ` Julia Lawall
2015-09-08 8:55 ` Linus Walleij
2015-08-24 21:12 ` [PATCH 2/2] pinctrl: digicolor: " Julia Lawall
1 sibling, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2015-08-24 21:12 UTC (permalink / raw)
To: Linus Walleij; +Cc: kernel-janitors, linux-gpio, linux-kernel
Since commit 323de9efdf3e ("pinctrl: make pinctrl_register() return proper
error code"), pinctrl_register returns an error code rather than NULL on
failure. Update some drivers that were introduced more recently.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e,e1,e2;
@@
e = pinctrl_register(...)
... when != e = e1
if (
- e = NULL
+ IS_ERR(e)
) {
...
return
- e2
+ PTR_ERR(e)
;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 4 ++--
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
index c978b31..e1a3721 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
@@ -723,9 +723,9 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
#endif
pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl);
- if (!pctrl->pctrl) {
+ if (IS_ERR(pctrl->pctrl)) {
dev_err(&pdev->dev, "couldn't register pm8xxx gpio driver\n");
- return -ENODEV;
+ return PTR_ERR(pctrl->pctrl);
}
pctrl->chip = pm8xxx_gpio_template;
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
index 2d1b69f..6652b8d 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
@@ -814,9 +814,9 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
#endif
pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl);
- if (!pctrl->pctrl) {
+ if (IS_ERR(pctrl->pctrl)) {
dev_err(&pdev->dev, "couldn't register pm8xxx mpp driver\n");
- return -ENODEV;
+ return PTR_ERR(pctrl->pctrl);
}
pctrl->chip = pm8xxx_mpp_template;
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] pinctrl: digicolor: convert null test to IS_ERR test
2015-08-24 21:12 [PATCH 0/2] convert null test to IS_ERR test Julia Lawall
2015-08-24 21:12 ` [PATCH 1/2] pinctrl: qcom: ssbi: " Julia Lawall
@ 2015-08-24 21:12 ` Julia Lawall
2015-08-25 4:33 ` Baruch Siach
2015-09-08 8:56 ` Linus Walleij
1 sibling, 2 replies; 6+ messages in thread
From: Julia Lawall @ 2015-08-24 21:12 UTC (permalink / raw)
To: linux-arm-kernel
Since commit 323de9efdf3e ("pinctrl: make pinctrl_register() return proper
error code"), pinctrl_register returns an error code rather than NULL on
failure. Update a driver that was introduced more recently.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e,e1,e2;
@@
e = pinctrl_register(...)
... when != e = e1
if (
- e = NULL
+ IS_ERR(e)
) {
...
return
- e2
+ PTR_ERR(e)
;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/pinctrl/pinctrl-digicolor.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
index 461fffc..11f8b83 100644
--- a/drivers/pinctrl/pinctrl-digicolor.c
+++ b/drivers/pinctrl/pinctrl-digicolor.c
@@ -337,9 +337,9 @@ static int dc_pinctrl_probe(struct platform_device *pdev)
pmap->dev = &pdev->dev;
pmap->pctl = pinctrl_register(pctl_desc, &pdev->dev, pmap);
- if (!pmap->pctl) {
+ if (IS_ERR(pmap->pctl)) {
dev_err(&pdev->dev, "pinctrl driver registration failed\n");
- return -EINVAL;
+ return PTR_ERR(pmap->pctl);
}
ret = dc_gpiochip_add(pmap, pdev->dev.of_node);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] pinctrl: digicolor: convert null test to IS_ERR test
2015-08-24 21:12 ` [PATCH 2/2] pinctrl: digicolor: " Julia Lawall
@ 2015-08-25 4:33 ` Baruch Siach
2015-09-08 8:56 ` Linus Walleij
1 sibling, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2015-08-25 4:33 UTC (permalink / raw)
To: linux-arm-kernel
Hi Julia,
On Mon, Aug 24, 2015 at 11:12:27PM +0200, Julia Lawall wrote:
> Since commit 323de9efdf3e ("pinctrl: make pinctrl_register() return proper
> error code"), pinctrl_register returns an error code rather than NULL on
> failure. Update a driver that was introduced more recently.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression e,e1,e2;
> @@
>
> e = pinctrl_register(...)
> ... when != e = e1
> if (
> - e = NULL
> + IS_ERR(e)
> ) {
> ...
> return
> - e2
> + PTR_ERR(e)
> ;
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Thanks,
baruch
> drivers/pinctrl/pinctrl-digicolor.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
> index 461fffc..11f8b83 100644
> --- a/drivers/pinctrl/pinctrl-digicolor.c
> +++ b/drivers/pinctrl/pinctrl-digicolor.c
> @@ -337,9 +337,9 @@ static int dc_pinctrl_probe(struct platform_device *pdev)
> pmap->dev = &pdev->dev;
>
> pmap->pctl = pinctrl_register(pctl_desc, &pdev->dev, pmap);
> - if (!pmap->pctl) {
> + if (IS_ERR(pmap->pctl)) {
> dev_err(&pdev->dev, "pinctrl driver registration failed\n");
> - return -EINVAL;
> + return PTR_ERR(pmap->pctl);
> }
>
> ret = dc_gpiochip_add(pmap, pdev->dev.of_node);
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{ - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] pinctrl: qcom: ssbi: convert null test to IS_ERR test
2015-08-24 21:12 ` [PATCH 1/2] pinctrl: qcom: ssbi: " Julia Lawall
@ 2015-09-08 8:55 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2015-09-08 8:55 UTC (permalink / raw)
To: Julia Lawall; +Cc: kernel-janitors, linux-gpio, linux-kernel
On Mon, Aug 24, 2015 at 11:12 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> Since commit 323de9efdf3e ("pinctrl: make pinctrl_register() return proper
> error code"), pinctrl_register returns an error code rather than NULL on
> failure. Update some drivers that were introduced more recently.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression e,e1,e2;
> @@
>
> e = pinctrl_register(...)
> ... when != e = e1
> if (
> - e = NULL
> + IS_ERR(e)
> ) {
> ...
> return
> - e2
> + PTR_ERR(e)
> ;
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Patch applied for fixes.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] pinctrl: digicolor: convert null test to IS_ERR test
2015-08-24 21:12 ` [PATCH 2/2] pinctrl: digicolor: " Julia Lawall
2015-08-25 4:33 ` Baruch Siach
@ 2015-09-08 8:56 ` Linus Walleij
1 sibling, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2015-09-08 8:56 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Aug 24, 2015 at 11:12 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> Since commit 323de9efdf3e ("pinctrl: make pinctrl_register() return proper
> error code"), pinctrl_register returns an error code rather than NULL on
> failure. Update a driver that was introduced more recently.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression e,e1,e2;
> @@
>
> e = pinctrl_register(...)
> ... when != e = e1
> if (
> - e = NULL
> + IS_ERR(e)
> ) {
> ...
> return
> - e2
> + PTR_ERR(e)
> ;
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Patch applied for fixes.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-08 8:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-24 21:12 [PATCH 0/2] convert null test to IS_ERR test Julia Lawall
2015-08-24 21:12 ` [PATCH 1/2] pinctrl: qcom: ssbi: " Julia Lawall
2015-09-08 8:55 ` Linus Walleij
2015-08-24 21:12 ` [PATCH 2/2] pinctrl: digicolor: " Julia Lawall
2015-08-25 4:33 ` Baruch Siach
2015-09-08 8:56 ` Linus Walleij
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).