* [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test
@ 2024-02-20 9:02 Dan Carpenter
2024-02-20 13:55 ` Andrew Davis
2024-02-21 23:05 ` Sebastian Reichel
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2024-02-20 9:02 UTC (permalink / raw)
To: Andrew Davis; +Cc: Sebastian Reichel, linux-pm, linux-kernel, kernel-janitors
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@linaro.org>
---
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))
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test
2024-02-20 9:02 [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test Dan Carpenter
@ 2024-02-20 13:55 ` Andrew Davis
2024-02-21 23:05 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Davis @ 2024-02-20 13:55 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Sebastian Reichel, linux-pm, linux-kernel, kernel-janitors
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@linaro.org>
> ---
Acked-by: Andrew Davis <afd@ti.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))
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test
2024-02-20 9:02 [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test Dan Carpenter
2024-02-20 13:55 ` Andrew Davis
@ 2024-02-21 23:05 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2024-02-21 23:05 UTC (permalink / raw)
To: Andrew Davis, Dan Carpenter
Cc: Sebastian Reichel, linux-pm, linux-kernel, kernel-janitors
On Tue, 20 Feb 2024 12:02:22 +0300, Dan Carpenter wrote:
> The devm_platform_ioremap_resource() function returns error points. It
> never returns NULL. Update the check accordingly.
>
>
Applied, thanks!
[1/1] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test
commit: 62f4b33bf2b966035420c3e211bfa37f697c4d1f
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-21 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-20 9:02 [PATCH] power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test Dan Carpenter
2024-02-20 13:55 ` Andrew Davis
2024-02-21 23:05 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®