From: Fabio Estevam <festevam@gmail.com>
To: wim@iguana.be
Cc: linux@roeck-us.net, linux-watchdog@vger.kernel.org,
wsa+renesas@sang-engineering.com, justinpopo6@gmail.com,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: [PATCH 1/2] watchdog: renesas-wdt: Check the return value from clk_prepare_enable()
Date: Sat, 22 Jul 2017 17:22:58 -0300 [thread overview]
Message-ID: <1500754979-19836-1-git-send-email-festevam@gmail.com> (raw)
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
next reply other threads:[~2017-07-22 20:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-22 20:22 Fabio Estevam [this message]
2017-07-22 20:22 ` [PATCH 2/2] watchdog: bcm7038: Check the return value from clk_prepare_enable() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1500754979-19836-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=justinpopo6@gmail.com \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=wim@iguana.be \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox