[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e69f523e-8d58-4a4f-af28-7238e818eac1@ti.com>
Date: Tue, 20 Feb 2024 07:55:35 -0600
From: Andrew Davis <afd@...com>
To: Dan Carpenter <dan.carpenter@...aro.org>
CC: Sebastian Reichel <sre@...nel.org>, <linux-pm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test
On 2/20/24 3:02 AM, Dan Carpenter wrote:
> The devm_platform_ioremap_resource() function returns error points. It
> never returns NULL. Update the check accordingly.
>
> Fixes: 7ddfd33c6ee5 ("power: reset: xgene-reboot: Use devm_platform_ioremap_resource() helper")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
Acked-by: Andrew Davis <afd@...com>
> drivers/power/reset/xgene-reboot.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/reset/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c
> index 867162dfe7ea..b5eee19bac42 100644
> --- a/drivers/power/reset/xgene-reboot.c
> +++ b/drivers/power/reset/xgene-reboot.c
> @@ -51,9 +51,9 @@ static int xgene_reboot_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> ctx->csr = devm_platform_ioremap_resource(pdev, 0);
> - if (!ctx->csr) {
> + if (IS_ERR(ctx->csr)) {
> dev_err(dev, "can not map resource\n");
> - return -ENODEV;
> + return PTR_ERR(ctx->csr);
> }
>
> if (of_property_read_u32(dev->of_node, "mask", &ctx->mask))
Powered by blists - more mailing lists