public inbox for linux-watchdog@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] watchdog: renesas-wdt: Check the return value from clk_prepare_enable()
@ 2017-07-22 20:22 Fabio Estevam
  2017-07-22 20:22 ` [PATCH 2/2] watchdog: bcm7038: " Fabio Estevam
  2017-07-22 20:31 ` [PATCH 1/2] watchdog: renesas-wdt: " Wolfram Sang
  0 siblings, 2 replies; 8+ messages in thread
From: Fabio Estevam @ 2017-07-22 20:22 UTC (permalink / raw)
  To: wim; +Cc: linux, linux-watchdog, wsa+renesas, justinpopo6, Fabio Estevam

From: Fabio Estevam <fabio.estevam@nxp.com>

clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/watchdog/renesas_wdt.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/renesas_wdt.c b/drivers/watchdog/renesas_wdt.c
index cf61c92..ca3dc4c 100644
--- a/drivers/watchdog/renesas_wdt.c
+++ b/drivers/watchdog/renesas_wdt.c
@@ -62,9 +62,13 @@ static int rwdt_init_timeout(struct watchdog_device *wdev)
 
 static int rwdt_start(struct watchdog_device *wdev)
 {
+	int ret;
+
 	struct rwdt_priv *priv = watchdog_get_drvdata(wdev);
 
-	clk_prepare_enable(priv->clk);
+	ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
 
 	rwdt_write(priv, priv->cks, RWTCSRA);
 	rwdt_init_timeout(wdev);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-07-23 14:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22 20:22 [PATCH 1/2] watchdog: renesas-wdt: Check the return value from clk_prepare_enable() Fabio Estevam
2017-07-22 20:22 ` [PATCH 2/2] watchdog: bcm7038: " Fabio Estevam
2017-07-22 21:29   ` Guenter Roeck
2017-07-22 20:31 ` [PATCH 1/2] watchdog: renesas-wdt: " Wolfram Sang
2017-07-22 21:24   ` Guenter Roeck
2017-07-22 21:28     ` Wolfram Sang
2017-07-22 21:30       ` Guenter Roeck
2017-07-23 14:58         ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox