diff mbox

[2/2] watchdog: s3c2410_wdt: Check return value of clk_prepare_enable

Message ID 1393925675-21636-2-git-send-email-sachin.kamat@linaro.org
State Accepted
Commit 01b6af91593629224490b76c4bf4b0eb8cfbfb31
Headers show

Commit Message

Sachin Kamat March 4, 2014, 9:34 a.m. UTC
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(-)

Comments

Wim Van Sebroeck March 15, 2014, 7:30 p.m. UTC | #1
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.

--
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
diff mbox

Patch

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) {