Commit 07bf971a authored by Jingoo Han's avatar Jingoo Han Committed by Wim Van Sebroeck

watchdog: sp805_wdt: use devm_clk_get()

Use devm_clk_get() to make cleanup paths more simple.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 4d2327ca
...@@ -231,7 +231,7 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -231,7 +231,7 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
goto err; goto err;
} }
wdt->clk = clk_get(&adev->dev, NULL); wdt->clk = devm_clk_get(&adev->dev, NULL);
if (IS_ERR(wdt->clk)) { if (IS_ERR(wdt->clk)) {
dev_warn(&adev->dev, "Clock not found\n"); dev_warn(&adev->dev, "Clock not found\n");
ret = PTR_ERR(wdt->clk); ret = PTR_ERR(wdt->clk);
...@@ -251,15 +251,13 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -251,15 +251,13 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
if (ret) { if (ret) {
dev_err(&adev->dev, "watchdog_register_device() failed: %d\n", dev_err(&adev->dev, "watchdog_register_device() failed: %d\n",
ret); ret);
goto err_register; goto err;
} }
amba_set_drvdata(adev, wdt); amba_set_drvdata(adev, wdt);
dev_info(&adev->dev, "registration successful\n"); dev_info(&adev->dev, "registration successful\n");
return 0; return 0;
err_register:
clk_put(wdt->clk);
err: err:
dev_err(&adev->dev, "Probe Failed!!!\n"); dev_err(&adev->dev, "Probe Failed!!!\n");
return ret; return ret;
...@@ -272,7 +270,6 @@ static int sp805_wdt_remove(struct amba_device *adev) ...@@ -272,7 +270,6 @@ static int sp805_wdt_remove(struct amba_device *adev)
watchdog_unregister_device(&wdt->wdd); watchdog_unregister_device(&wdt->wdd);
amba_set_drvdata(adev, NULL); amba_set_drvdata(adev, NULL);
watchdog_set_drvdata(&wdt->wdd, NULL); watchdog_set_drvdata(&wdt->wdd, NULL);
clk_put(wdt->clk);
return 0; return 0;
} }
......
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