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

power/reset: at91: fix return value check in at91_reset_platform_probe()

In case of error, the function devm_ioremap() returns NULL
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.

Fixes: ecfe64d8c55f ("power: reset: Add AT91 reset driver")
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

authored by

Wei Yongjun and committed by
Sebastian Reichel
932df430 2a6afddb

+2 -2
+2 -2
drivers/power/reset/at91-reset.c
··· 212 212 res = platform_get_resource(pdev, IORESOURCE_MEM, idx + 1 ); 213 213 at91_ramc_base[idx] = devm_ioremap(&pdev->dev, res->start, 214 214 resource_size(res)); 215 - if (IS_ERR(at91_ramc_base[idx])) { 215 + if (!at91_ramc_base[idx]) { 216 216 dev_err(&pdev->dev, "Could not map ram controller address\n"); 217 - return PTR_ERR(at91_ramc_base[idx]); 217 + return -ENOMEM; 218 218 } 219 219 } 220 220