Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Sebastian Reichel
62f4b33b a9b25489

+2 -2
+2 -2
drivers/power/reset/xgene-reboot.c
··· 51 51 return -ENOMEM; 52 52 53 53 ctx->csr = devm_platform_ioremap_resource(pdev, 0); 54 - if (!ctx->csr) { 54 + if (IS_ERR(ctx->csr)) { 55 55 dev_err(dev, "can not map resource\n"); 56 - return -ENODEV; 56 + return PTR_ERR(ctx->csr); 57 57 } 58 58 59 59 if (of_property_read_u32(dev->of_node, "mask", &ctx->mask))