Commit 413bf4e8 authored by Chen Ni's avatar Chen Ni Committed by Wim Van Sebroeck

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: e86bd43b ("watchdog: sa1100: use platform device registration")
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240426075808.1582678-1-nichen@iscas.ac.cnSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent cae58516
......@@ -191,9 +191,8 @@ static int sa1100dog_probe(struct platform_device *pdev)
if (!res)
return -ENXIO;
reg_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
ret = PTR_ERR_OR_ZERO(reg_base);
if (ret)
return ret;
if (!reg_base)
return -ENOMEM;
clk = clk_get(NULL, "OSTIMER0");
if (IS_ERR(clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment