linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Chen Ni <nichen@iscas.ac.cn>, wim@linux-watchdog.org, arnd@arndb.de
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe()
Date: Fri, 26 Apr 2024 06:36:23 -0700	[thread overview]
Message-ID: <41e47453-a014-4450-bc5b-3ef76f09b786@roeck-us.net> (raw)
In-Reply-To: <20240426075808.1582678-1-nichen@iscas.ac.cn>

On 4/26/24 00:58, Chen Ni wrote:
> devm_ioremap() doesn't return error pointers, it returns NULL on error.
> Update the check accordingly.
> 
> Fixes: e86bd43bcfc5 ("watchdog: sa1100: use platform device registration")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/sa1100_wdt.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
> index 5d2df008b92a..34a917221e31 100644
> --- a/drivers/watchdog/sa1100_wdt.c
> +++ b/drivers/watchdog/sa1100_wdt.c
> @@ -191,9 +191,8 @@ static int sa1100dog_probe(struct platform_device *pdev)
>   	if (!res)
>   		return -ENXIO;
>   	reg_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> -	ret = PTR_ERR_OR_ZERO(reg_base);
> -	if (ret)
> -		return ret;
> +	if (!reg_base)
> +		return -ENOMEM;
>   
>   	clk = clk_get(NULL, "OSTIMER0");
>   	if (IS_ERR(clk)) {


      reply	other threads:[~2024-04-26 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  7:58 [PATCH] watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe() Chen Ni
2024-04-26 13:36 ` Guenter Roeck [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=41e47453-a014-4450-bc5b-3ef76f09b786@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=nichen@iscas.ac.cn \
    --cc=wim@linux-watchdog.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;
as well as URLs for NNTP newsgroup(s).