drivers: pinctrl: vt8500: use devm_ioremap_resource()
PATCH 1/1 drivers: pinctrl: vt8500: use devm_ioremap_resource()
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
--- drivers/pinctrl/vt8500/pinctrl-wmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pinctrl/vt8500/pinctrl-wmt.c +3 -3
@@ -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;
Signature · 1 line
1.7.10.4
Quoted 1 line · Laurent Navet
Replace a call to deprecated
devm_request_and_ioremapbydevm_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..?
Quoted 4 lines
Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_ioremap_resource.cocciSigned-off-by Laurent Navet <[email protected]>
Seems OK if the deprecation is ongoing.
Tony can I have your ACK?
Quoted 9 lines
drivers/pinctrl/vt8500/pinctrl-wmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/pinctrl/vt8500/pinctrl-wmt.c +0
-0@@ -569,10 +569,10 @@ int wmt_pinctrl_probe(struct platform_device *pdev,struct resource *res;
drivers/pinctrl/vt8500/pinctrl-wmt.c int wmt_pinctrl_probe(struct platform_device *pdev, · line 576
Quoted 10 lines
drivers/pinctrl/vt8500/pinctrl-wmt.c +3
-3res =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
Quoted 4 lines
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
Quoted 3 lines
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,
Tony Prisk
Acked-byQuoted 7 lines · Linus Walleij
Quoted 1 line · Laurent Navet
Replace a call to deprecated
devm_request_and_ioremapbydevm_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..?
Quoted 6 lines
Quoted 4 lines
Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_ioremap_resource.cocciSigned-off-by Laurent Navet <[email protected]>Seems OK if the deprecation is ongoing.
Tony can I have your ACK?
Quoted 6 lines · Laurent Navet
Replace a call to deprecated
devm_request_and_ioremapbydevm_ioremap_resource.Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_ioremap_resource.cocciSigned-off-by Laurent Navet <[email protected]>
Patch applied with Tony's ACK.
Thanks!
Linus Walleij