Skip to content

Commit 413bf4e

Browse files
Chen NiWim Van Sebroeck
authored andcommitted
watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe()
devm_ioremap() doesn't return error pointers, it returns NULL on error. Update the check accordingly. Fixes: e86bd43 ("watchdog: sa1100: use platform device registration") Signed-off-by: Chen Ni <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent cae5851 commit 413bf4e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/watchdog/sa1100_wdt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,8 @@ static int sa1100dog_probe(struct platform_device *pdev)
191191
if (!res)
192192
return -ENXIO;
193193
reg_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
194-
ret = PTR_ERR_OR_ZERO(reg_base);
195-
if (ret)
196-
return ret;
194+
if (!reg_base)
195+
return -ENOMEM;
197196

198197
clk = clk_get(NULL, "OSTIMER0");
199198
if (IS_ERR(clk)) {

0 commit comments

Comments
 (0)