From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Wei Yongjun <weiyj.lk@gmail.com>, axel.lin@ingics.com
Cc: thierry.reding@gmail.com, yongjun_wei@trendmicro.com.cn,
linux-pwm@vger.kernel.org
Subject: Re: [PATCH -next] pwm: renesas-tpu: fix return value check in tpu_probe()
Date: Tue, 25 Jun 2013 10:59:49 +0200 [thread overview]
Message-ID: <19060081.EBSPSCq8RF@avalon> (raw)
In-Reply-To: <CAPgLHd8x180B9OxscFeiLrnYT4dUf66hZCxSJO_1E+uE5udx0A@mail.gmail.com>
Hi Wei,
Thank you for the patch.
On Tuesday 25 June 2013 10:09:57 Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function devm_ioremap_resource() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
With the change noted below,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Thierry, do you need a v2, or can you fix the patch while applying ?
> ---
> drivers/pwm/pwm-renesas-tpu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
> index 96e0cc4..70950e5 100644
> --- a/drivers/pwm/pwm-renesas-tpu.c
> +++ b/drivers/pwm/pwm-renesas-tpu.c
> @@ -410,9 +410,9 @@ static int tpu_probe(struct platform_device *pdev)
> }
>
> tpu->base = devm_ioremap_resource(&pdev->dev, res);
> - if (tpu->base == NULL) {
> + if (IS_ERR(tpu->base)) {
> dev_err(&pdev->dev, "failed to remap I/O memory\n");
> - return -ENXIO;
> + return PTR_ERR(tpu->base);
> }
You can remove the dev_err call well, devm_ioremap_resource() prints an error
message already.
tpu->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(tpu->base))
return PTR_ERR(tpu->base);
>
> tpu->clk = devm_clk_get(&pdev->dev, NULL);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-06-25 8:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 2:09 [PATCH -next] pwm: renesas-tpu: fix return value check in tpu_probe() Wei Yongjun
2013-06-25 2:59 ` Axel Lin
2013-06-25 8:59 ` Laurent Pinchart [this message]
2013-06-25 10:18 ` Thierry Reding
2013-06-25 10:21 ` Thierry Reding
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=19060081.EBSPSCq8RF@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=axel.lin@ingics.com \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=weiyj.lk@gmail.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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