diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2024-02-20 10:02:22 +0100 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2024-02-21 21:13:37 +0100 |
commit | 62f4b33bf2b966035420c3e211bfa37f697c4d1f (patch) | |
tree | 8f33dd56a32f489ca0e1d4ffff0e00acd52b5cee /drivers/power | |
parent | power: supply: axp288_fuel_gauge: Add STCK1A* Intel Compute Sticks to the den... (diff) | |
download | linux-62f4b33bf2b966035420c3e211bfa37f697c4d1f.tar.xz linux-62f4b33bf2b966035420c3e211bfa37f697c4d1f.zip |
power: reset: xgene-reboot: Fix a NULL vs IS_ERR() test
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>
Link: https://lore.kernel.org/r/fe1b90d0-7234-4e03-accc-69a119f6a7eb@moroto.mountain
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/reset/xgene-reboot.c | 4 |
1 files 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)) |