]> Git Repo - linux.git/commitdiff
watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe()
authorChen Ni <[email protected]>
Fri, 26 Apr 2024 07:58:08 +0000 (15:58 +0800)
committerWim Van Sebroeck <[email protected]>
Sat, 4 May 2024 10:50:43 +0000 (12:50 +0200)
devm_ioremap() doesn't return error pointers, it returns NULL on error.
Update the check accordingly.

Fixes: e86bd43bcfc5 ("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]>
drivers/watchdog/sa1100_wdt.c

index 5d2df008b92a5c88da6c115b99fb60707c851450..34a917221e316f2d8d37db07acdfd7a8fc66e000 100644 (file)
@@ -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)) {
This page took 0.058826 seconds and 4 git commands to generate.