Skip to content

Commit 932df43

Browse files
Wei Yongjunsre
Wei Yongjun
authored andcommitted
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: ecfe64d ("power: reset: Add AT91 reset driver") Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 2a6afdd commit 932df43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/power/reset/at91-reset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ static int at91_reset_platform_probe(struct platform_device *pdev)
212212
res = platform_get_resource(pdev, IORESOURCE_MEM, idx + 1 );
213213
at91_ramc_base[idx] = devm_ioremap(&pdev->dev, res->start,
214214
resource_size(res));
215-
if (IS_ERR(at91_ramc_base[idx])) {
215+
if (!at91_ramc_base[idx]) {
216216
dev_err(&pdev->dev, "Could not map ram controller address\n");
217-
return PTR_ERR(at91_ramc_base[idx]);
217+
return -ENOMEM;
218218
}
219219
}
220220

0 commit comments

Comments
 (0)