]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/watchdog/tangox_wdt.c
Merge branches 'pm-cpufreq', 'pm-cpuidle' and 'acpi-cppc'
[mirror_ubuntu-hirsute-kernel.git] / drivers / watchdog / tangox_wdt.c
index 709c1ed6fd79b9237710802b238eb6a2fa85ef0a..cfbed7e051b619f5edec8c93a3b964373d9b9e0f 100644 (file)
@@ -139,6 +139,10 @@ static int tangox_wdt_probe(struct platform_device *pdev)
                return err;
 
        dev->clk_rate = clk_get_rate(dev->clk);
+       if (!dev->clk_rate) {
+               err = -EINVAL;
+               goto err;
+       }
 
        dev->wdt.parent = &pdev->dev;
        dev->wdt.info = &tangox_wdt_info;
@@ -171,10 +175,8 @@ static int tangox_wdt_probe(struct platform_device *pdev)
        }
 
        err = watchdog_register_device(&dev->wdt);
-       if (err) {
-               clk_disable_unprepare(dev->clk);
-               return err;
-       }
+       if (err)
+               goto err;
 
        platform_set_drvdata(pdev, dev);
 
@@ -187,6 +189,10 @@ static int tangox_wdt_probe(struct platform_device *pdev)
        dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n");
 
        return 0;
+
+ err:
+       clk_disable_unprepare(dev->clk);
+       return err;
 }
 
 static int tangox_wdt_remove(struct platform_device *pdev)