watchdog: davinci: Add missing clk_disable_unprepare().
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 6 Jun 2017 10:38:31 +0000 (16:08 +0530)
committerWim Van Sebroeck <wim@iguana.be>
Mon, 3 Jul 2017 09:02:43 +0000 (11:02 +0200)
davinci_wdt_probe() can fail here and we must disable clock.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/davinci_wdt.c

index 1ba9ead7d75a3b51be53276ef78df86db9d25157..2f46487af86d05a72216030e188feb74777b546e 100644 (file)
@@ -202,8 +202,10 @@ static int davinci_wdt_probe(struct platform_device *pdev)
                return PTR_ERR(davinci_wdt->base);
 
        ret = watchdog_register_device(wdd);
-       if (ret < 0)
+       if (ret < 0) {
+               clk_disable_unprepare(davinci_wdt->clk);
                dev_err(dev, "cannot register watchdog device\n");
+       }
 
        return ret;
 }