* [PATCH RESEND 2/5] watchdog: imx2_wdt: use devm_clk_get()
@ 2013-04-29 9:15 Jingoo Han
2013-04-29 16:33 ` Guenter Roeck
2013-05-25 20:03 ` Wim Van Sebroeck
0 siblings, 2 replies; 3+ messages in thread
From: Jingoo Han @ 2013-04-29 9:15 UTC (permalink / raw)
To: 'Andrew Morton'
Cc: linux-kernel, 'Wim Van Sebroeck', linux-watchdog,
Jingoo Han
Use devm_clk_get() to make cleanup paths more simple.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/watchdog/imx2_wdt.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index ff90882..0c2b075 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -266,7 +266,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
if (IS_ERR(imx2_wdt.base))
return PTR_ERR(imx2_wdt.base);
- imx2_wdt.clk = clk_get(&pdev->dev, NULL);
+ imx2_wdt.clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(imx2_wdt.clk)) {
dev_err(&pdev->dev, "can't get Watchdog clock\n");
return PTR_ERR(imx2_wdt.clk);
@@ -291,7 +291,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
fail:
imx2_wdt_miscdev.parent = NULL;
- clk_put(imx2_wdt.clk);
return ret;
}
@@ -304,8 +303,7 @@ static int __exit imx2_wdt_remove(struct platform_device *pdev)
dev_crit(imx2_wdt_miscdev.parent,
"Device removed: Expect reboot!\n");
- } else
- clk_put(imx2_wdt.clk);
+ }
imx2_wdt_miscdev.parent = NULL;
return 0;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND 2/5] watchdog: imx2_wdt: use devm_clk_get()
2013-04-29 9:15 [PATCH RESEND 2/5] watchdog: imx2_wdt: use devm_clk_get() Jingoo Han
@ 2013-04-29 16:33 ` Guenter Roeck
2013-05-25 20:03 ` Wim Van Sebroeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2013-04-29 16:33 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Andrew Morton', linux-kernel, 'Wim Van Sebroeck',
linux-watchdog
On Mon, Apr 29, 2013 at 06:15:53PM +0900, Jingoo Han wrote:
> 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>
> ---
> drivers/watchdog/imx2_wdt.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
> index ff90882..0c2b075 100644
> --- a/drivers/watchdog/imx2_wdt.c
> +++ b/drivers/watchdog/imx2_wdt.c
> @@ -266,7 +266,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
> if (IS_ERR(imx2_wdt.base))
> return PTR_ERR(imx2_wdt.base);
>
> - imx2_wdt.clk = clk_get(&pdev->dev, NULL);
> + imx2_wdt.clk = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(imx2_wdt.clk)) {
> dev_err(&pdev->dev, "can't get Watchdog clock\n");
> return PTR_ERR(imx2_wdt.clk);
> @@ -291,7 +291,6 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
>
> fail:
> imx2_wdt_miscdev.parent = NULL;
> - clk_put(imx2_wdt.clk);
> return ret;
> }
>
> @@ -304,8 +303,7 @@ static int __exit imx2_wdt_remove(struct platform_device *pdev)
>
> dev_crit(imx2_wdt_miscdev.parent,
> "Device removed: Expect reboot!\n");
> - } else
> - clk_put(imx2_wdt.clk);
> + }
>
> imx2_wdt_miscdev.parent = NULL;
> return 0;
> --
> 1.7.2.5
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND 2/5] watchdog: imx2_wdt: use devm_clk_get()
2013-04-29 9:15 [PATCH RESEND 2/5] watchdog: imx2_wdt: use devm_clk_get() Jingoo Han
2013-04-29 16:33 ` Guenter Roeck
@ 2013-05-25 20:03 ` Wim Van Sebroeck
1 sibling, 0 replies; 3+ messages in thread
From: Wim Van Sebroeck @ 2013-05-25 20:03 UTC (permalink / raw)
To: Jingoo Han; +Cc: 'Andrew Morton', linux-kernel, linux-watchdog
Hi Jingoo,
> Use devm_clk_get() to make cleanup paths more simple.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
> drivers/watchdog/imx2_wdt.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
Patch added to linux-watchdog-next.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-25 20:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29 9:15 [PATCH RESEND 2/5] watchdog: imx2_wdt: use devm_clk_get() Jingoo Han
2013-04-29 16:33 ` Guenter Roeck
2013-05-25 20:03 ` Wim Van Sebroeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox