lkml.org 
[lkml]   [2013]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource()
From
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


\
 
 \ /
  Last update: 2013-05-14 15:01    [W:0.032 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site