* [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization
@ 2014-03-04 9:34 Sachin Kamat
2014-03-04 9:34 ` [PATCH 2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable Sachin Kamat
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sachin Kamat @ 2014-03-04 9:34 UTC (permalink / raw)
To: linux-watchdog; +Cc: linux-samsung-soc, wim, sachin.kamat
Initializing clk to NULL as a reset/error condition does not
help as NULL is not an invalid condition w.r.t clk. Remove this
initialization altogether as there is no state retention.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/watchdog/s3c2410_wdt.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index aba6cd46b45b..a0f8f771adec 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -607,7 +607,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
err_clk:
clk_disable_unprepare(wdt->clock);
- wdt->clock = NULL;
err:
return ret;
@@ -627,7 +626,6 @@ static int s3c2410wdt_remove(struct platform_device *dev)
s3c2410wdt_cpufreq_deregister(wdt);
clk_disable_unprepare(wdt->clock);
- wdt->clock = NULL;
return 0;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable
2014-03-04 9:34 [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization Sachin Kamat
@ 2014-03-04 9:34 ` Sachin Kamat
2014-03-15 19:30 ` Wim Van Sebroeck
2014-03-10 2:32 ` [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization Guenter Roeck
2014-03-15 19:29 ` Wim Van Sebroeck
2 siblings, 1 reply; 5+ messages in thread
From: Sachin Kamat @ 2014-03-04 9:34 UTC (permalink / raw)
To: linux-watchdog; +Cc: linux-samsung-soc, wim, sachin.kamat
clk_prepare_enable can fail. Check its return value.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/watchdog/s3c2410_wdt.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index a0f8f771adec..7c6ccd071baf 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -525,7 +525,11 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
goto err;
}
- clk_prepare_enable(wdt->clock);
+ ret = clk_prepare_enable(wdt->clock);
+ if (ret < 0) {
+ dev_err(dev, "failed to enable clock\n");
+ return ret;
+ }
ret = s3c2410wdt_cpufreq_register(wdt);
if (ret < 0) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization
2014-03-04 9:34 [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization Sachin Kamat
2014-03-04 9:34 ` [PATCH 2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable Sachin Kamat
@ 2014-03-10 2:32 ` Guenter Roeck
2014-03-15 19:29 ` Wim Van Sebroeck
2 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2014-03-10 2:32 UTC (permalink / raw)
To: Sachin Kamat, linux-watchdog; +Cc: linux-samsung-soc, wim
On 03/04/2014 01:34 AM, Sachin Kamat wrote:
> Initializing clk to NULL as a reset/error condition does not
> help as NULL is not an invalid condition w.r.t clk. Remove this
> initialization altogether as there is no state retention.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization
2014-03-04 9:34 [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization Sachin Kamat
2014-03-04 9:34 ` [PATCH 2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable Sachin Kamat
2014-03-10 2:32 ` [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization Guenter Roeck
@ 2014-03-15 19:29 ` Wim Van Sebroeck
2 siblings, 0 replies; 5+ messages in thread
From: Wim Van Sebroeck @ 2014-03-15 19:29 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-watchdog, linux-samsung-soc
Hi Sachin,
> Initializing clk to NULL as a reset/error condition does not
> help as NULL is not an invalid condition w.r.t clk. Remove this
> initialization altogether as there is no state retention.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/watchdog/s3c2410_wdt.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> index aba6cd46b45b..a0f8f771adec 100644
> --- a/drivers/watchdog/s3c2410_wdt.c
> +++ b/drivers/watchdog/s3c2410_wdt.c
> @@ -607,7 +607,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
>
> err_clk:
> clk_disable_unprepare(wdt->clock);
> - wdt->clock = NULL;
>
> err:
> return ret;
> @@ -627,7 +626,6 @@ static int s3c2410wdt_remove(struct platform_device *dev)
> s3c2410wdt_cpufreq_deregister(wdt);
>
> clk_disable_unprepare(wdt->clock);
> - wdt->clock = NULL;
>
> return 0;
> }
Patch has been added to linux-watchdog-next.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable
2014-03-04 9:34 ` [PATCH 2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable Sachin Kamat
@ 2014-03-15 19:30 ` Wim Van Sebroeck
0 siblings, 0 replies; 5+ messages in thread
From: Wim Van Sebroeck @ 2014-03-15 19:30 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-watchdog, linux-samsung-soc
Hi Sachin,
> clk_prepare_enable can fail. Check its return value.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/watchdog/s3c2410_wdt.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
> index a0f8f771adec..7c6ccd071baf 100644
> --- a/drivers/watchdog/s3c2410_wdt.c
> +++ b/drivers/watchdog/s3c2410_wdt.c
> @@ -525,7 +525,11 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
> goto err;
> }
>
> - clk_prepare_enable(wdt->clock);
> + ret = clk_prepare_enable(wdt->clock);
> + if (ret < 0) {
> + dev_err(dev, "failed to enable clock\n");
> + return ret;
> + }
>
> ret = s3c2410wdt_cpufreq_register(wdt);
> if (ret < 0) {
Patch has been added to linux-watchdog-next.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-15 19:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 9:34 [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization Sachin Kamat
2014-03-04 9:34 ` [PATCH 2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable Sachin Kamat
2014-03-15 19:30 ` Wim Van Sebroeck
2014-03-10 2:32 ` [PATCH 1/2] watchdog: s3c2410_wdt: Remove unneeded initialization Guenter Roeck
2014-03-15 19:29 ` 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;
as well as URLs for NNTP newsgroup(s).