* [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()
@ 2013-05-12 14:59 Laurent Navet
2013-05-14 12:52 ` Linus Walleij
2013-05-15 8:45 ` Linus Walleij
0 siblings, 2 replies; 5+ messages in thread
From: Laurent Navet @ 2013-05-12 14:59 UTC (permalink / raw)
To: linus.walleij; +Cc: linux, swarren, olof, axel.lin, linux-kernel, Laurent Navet
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_ioremap_resource.cocci
Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
---
drivers/pinctrl/vt8500/pinctrl-wmt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index ab63104..e877082 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -569,10 +569,10 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- data->base = devm_request_and_ioremap(&pdev->dev, res);
- if (!data->base) {
+ data->base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(data->base)) {
dev_err(&pdev->dev, "failed to map memory resource\n");
- return -EBUSY;
+ return PTR_ERR(data->base);
}
wmt_desc.pins = data->pins;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()
2013-05-12 14:59 [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource() Laurent Navet
@ 2013-05-14 12:52 ` Linus Walleij
2013-05-14 14:16 ` Laurent Navet
2013-05-14 17:49 ` Tony Prisk
2013-05-15 8:45 ` Linus Walleij
1 sibling, 2 replies; 5+ messages in thread
From: Linus Walleij @ 2013-05-14 12:52 UTC (permalink / raw)
To: Laurent Navet, Grant Likely
Cc: Tony Prisk, Stephen Warren, Olof Johansson, Axel Lin,
linux-kernel@vger.kernel.org
On Sun, May 12, 2013 at 4:59 PM, Laurent Navet <laurent.navet@gmail.com> wrote:
> Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
Oh is that deprecated? I had no clue :-/
Can you point to some rationale about this so I'm not
totally misguided in my world..?
> Found with coccicheck and this semantic patch:
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Seems OK if the deprecation is ongoing.
Tony can I have your ACK?
> drivers/pinctrl/vt8500/pinctrl-wmt.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
> index ab63104..e877082 100644
> --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
> +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
> @@ -569,10 +569,10 @@ int wmt_pinctrl_probe(struct platform_device *pdev,
> struct resource *res;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - data->base = devm_request_and_ioremap(&pdev->dev, res);
> - if (!data->base) {
> + data->base = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(data->base)) {
> dev_err(&pdev->dev, "failed to map memory resource\n");
> - return -EBUSY;
> + return PTR_ERR(data->base);
> }
Grant is just going to *not* love this type of patches replacing
nullchecks with IS_ERR() stuff all over the kernel.
We had a discussion whether the compiler can be made to
annotate and typecheck pointers to avoid doing mistakes with
pointers containing error codes like this. (Vague but you maybe
know what I'm after.)
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()
2013-05-14 12:52 ` Linus Walleij
@ 2013-05-14 14:16 ` Laurent Navet
2013-05-14 17:49 ` Tony Prisk
1 sibling, 0 replies; 5+ messages in thread
From: Laurent Navet @ 2013-05-14 14:16 UTC (permalink / raw)
To: Linus Walleij
Cc: Grant Likely, Tony Prisk, Stephen Warren, Olof Johansson,
Axel Lin, linux-kernel@vger.kernel.org
> Oh is that deprecated? I had no clue :-/
> Can you point to some rationale about this so I'm not
> totally misguided in my world..?
>
Yes: https://lkml.org/lkml/2013/1/21/360
>
> Grant is just going to *not* love this type of patches replacing
> nullchecks with IS_ERR() stuff all over the kernel.
again, yes : https://lkml.org/lkml/2013/2/9/52
Laurent,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()
2013-05-14 12:52 ` Linus Walleij
2013-05-14 14:16 ` Laurent Navet
@ 2013-05-14 17:49 ` Tony Prisk
1 sibling, 0 replies; 5+ messages in thread
From: Tony Prisk @ 2013-05-14 17:49 UTC (permalink / raw)
To: Linus Walleij
Cc: Laurent Navet, Grant Likely, Stephen Warren, Olof Johansson,
Axel Lin, linux-kernel@vger.kernel.org
On 15/05/13 00:52, Linus Walleij wrote:
> On Sun, May 12, 2013 at 4:59 PM, Laurent Navet <laurent.navet@gmail.com> wrote:
>
>> Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
> Oh is that deprecated? I had no clue :-/
> Can you point to some rationale about this so I'm not
> totally misguided in my world..?
>
>> Found with coccicheck and this semantic patch:
>> scripts/coccinelle/api/devm_ioremap_resource.cocci
>>
>> Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
> Seems OK if the deprecation is ongoing.
> Tony can I have your ACK?
Acked-by: Tony Prisk <linux@prisktech.co.nz>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()
2013-05-12 14:59 [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource() Laurent Navet
2013-05-14 12:52 ` Linus Walleij
@ 2013-05-15 8:45 ` Linus Walleij
1 sibling, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2013-05-15 8:45 UTC (permalink / raw)
To: Laurent Navet
Cc: Tony Prisk, Stephen Warren, Olof Johansson, Axel Lin,
linux-kernel@vger.kernel.org
On Sun, May 12, 2013 at 4:59 PM, Laurent Navet <laurent.navet@gmail.com> wrote:
> Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.
>
> Found with coccicheck and this semantic patch:
> scripts/coccinelle/api/devm_ioremap_resource.cocci
>
> Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Patch applied with Tony's ACK.
Thanks!
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-15 8:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-12 14:59 [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource() Laurent Navet
2013-05-14 12:52 ` Linus Walleij
2013-05-14 14:16 ` Laurent Navet
2013-05-14 17:49 ` Tony Prisk
2013-05-15 8:45 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox