]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
wdt: dw: Fix passing NULL pointer to reset functions
authorSean Anderson <seanga2@gmail.com>
Sat, 11 Sep 2021 19:11:30 +0000 (15:11 -0400)
committerStefan Roese <sr@denx.de>
Mon, 20 Sep 2021 05:39:29 +0000 (07:39 +0200)
reset_*_bulk expects a real pointer.

Fixes: 4f7abafe1c ("driver: watchdog: reset watchdog in designware_wdt_stop() function")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/watchdog/designware_wdt.c

index afed81e6c65567e958605ef4537c8d231d2f0e3d..cfec29bd158c7a9a976536177793a990f60e005b 100644 (file)
@@ -22,7 +22,7 @@
 struct designware_wdt_priv {
        void __iomem    *base;
        unsigned int    clk_khz;
-       struct reset_ctl_bulk *resets;
+       struct reset_ctl_bulk resets;
 };
 
 /*
@@ -99,11 +99,11 @@ static int designware_wdt_stop(struct udevice *dev)
         if (CONFIG_IS_ENABLED(DM_RESET)) {
                int ret;
 
-               ret = reset_assert_bulk(priv->resets);
+               ret = reset_assert_bulk(&priv->resets);
                if (ret)
                        return ret;
 
-               ret = reset_deassert_bulk(priv->resets);
+               ret = reset_deassert_bulk(&priv->resets);
                if (ret)
                        return ret;
        }
@@ -156,11 +156,11 @@ static int designware_wdt_probe(struct udevice *dev)
 #endif
 
        if (CONFIG_IS_ENABLED(DM_RESET)) {
-               ret = reset_get_bulk(dev, priv->resets);
+               ret = reset_get_bulk(dev, &priv->resets);
                if (ret)
                        goto err;
 
-               ret = reset_deassert_bulk(priv->resets);
+               ret = reset_deassert_bulk(&priv->resets);
                if (ret)
                        goto err;
        }