From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Laurent Navet <laurent.navet@gmail.com>
Cc: dwmw2@infradead.org, artem.bityutskiy@linux.intel.com,
m-karicheri2@ti.com, mturquette@linaro.org,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: mtd: nand: davinci: use devm_ioremap_resource()
Date: Thu, 02 May 2013 17:30:24 +0400 [thread overview]
Message-ID: <51826A70.9050904@cogentembedded.com> (raw)
In-Reply-To: <1367500934-28030-1-git-send-email-laurent.navet@gmail.com>
Hello.
On 02-05-2013 17:22, Laurent Navet 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_request_and_ioremap.cocci.
> Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
> ---
> drivers/mtd/nand/davinci_nand.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
> diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
> index 94e17af..4a96e58 100644
> --- a/drivers/mtd/nand/davinci_nand.c
> +++ b/drivers/mtd/nand/davinci_nand.c
> @@ -623,11 +623,14 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
> goto err_nomem;
> }
>
> - vaddr = devm_request_and_ioremap(&pdev->dev, res1);
> - base = devm_request_and_ioremap(&pdev->dev, res2);
> - if (!vaddr || !base) {
> - dev_err(&pdev->dev, "ioremap failed\n");
> - ret = -EADDRNOTAVAIL;
> + vaddr = devm_ioremap_resource(&pdev->dev, res1);
> + base = devm_ioremap_resource(&pdev->dev, res2);
I'd rather put this line before its corresponding error check.
> + if (IS_ERR(vaddr)) {
> + ret = PTR_ERR(vaddr);
> + goto err_ioremap;
> + }
> + if (IS_ERR(base)) {
> + ret = PTR_ERR(base);
> goto err_ioremap;
> }
WBR, Sergei
prev parent reply other threads:[~2013-05-02 13:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 13:22 [PATCH] drivers: mtd: nand: davinci: use devm_ioremap_resource() Laurent Navet
2013-05-02 13:30 ` Sergei Shtylyov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51826A70.9050904@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=dwmw2@infradead.org \
--cc=laurent.navet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=m-karicheri2@ti.com \
--cc=mturquette@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox