watchdog: dw_wdt: use devm_clk_get()
Use devm_clk_get() to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
Родитель
9d8a7f16f4
Коммит
cf3cc8c252
|
@ -305,13 +305,13 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
|
||||||
if (IS_ERR(dw_wdt.regs))
|
if (IS_ERR(dw_wdt.regs))
|
||||||
return PTR_ERR(dw_wdt.regs);
|
return PTR_ERR(dw_wdt.regs);
|
||||||
|
|
||||||
dw_wdt.clk = clk_get(&pdev->dev, NULL);
|
dw_wdt.clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(dw_wdt.clk))
|
if (IS_ERR(dw_wdt.clk))
|
||||||
return PTR_ERR(dw_wdt.clk);
|
return PTR_ERR(dw_wdt.clk);
|
||||||
|
|
||||||
ret = clk_enable(dw_wdt.clk);
|
ret = clk_enable(dw_wdt.clk);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_put_clk;
|
return ret;
|
||||||
|
|
||||||
spin_lock_init(&dw_wdt.lock);
|
spin_lock_init(&dw_wdt.lock);
|
||||||
|
|
||||||
|
@ -327,8 +327,6 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
out_disable_clk:
|
out_disable_clk:
|
||||||
clk_disable(dw_wdt.clk);
|
clk_disable(dw_wdt.clk);
|
||||||
out_put_clk:
|
|
||||||
clk_put(dw_wdt.clk);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -338,7 +336,6 @@ static int dw_wdt_drv_remove(struct platform_device *pdev)
|
||||||
misc_deregister(&dw_wdt_miscdev);
|
misc_deregister(&dw_wdt_miscdev);
|
||||||
|
|
||||||
clk_disable(dw_wdt.clk);
|
clk_disable(dw_wdt.clk);
|
||||||
clk_put(dw_wdt.clk);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче