From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: linux-i2c@vger.kernel.org
Cc: Magnus Damm <magnus.damm@gmail.com>,
linux-sh@vger.kernel.org, Wolfram Sang <wsa@the-dreams.de>,
devicetree@vger.kernel.org,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Subject: [PATCH 4/5] i2c: rcar: fix clk_get() error handling
Date: Mon, 9 Sep 2013 17:55:19 +0200 [thread overview]
Message-ID: <1378742120-11135-5-git-send-email-g.liakhovetski@gmx.de> (raw)
In-Reply-To: <1378742120-11135-1-git-send-email-g.liakhovetski@gmx.de>
When clk_get() fails, it returns an error code, not a NULL. This patch
fixes such an error handling bug.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
---
drivers/i2c/busses/i2c-rcar.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index be801b9..7e71cf4 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -234,9 +234,9 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
u32 cdf_width;
unsigned long rate;
- if (!clkp) {
- dev_err(dev, "there is no peripheral_clk\n");
- return -EIO;
+ if (IS_ERR(clkp)) {
+ dev_err(dev, "couldn't get clock\n");
+ return PTR_ERR(clkp);
}
switch (priv->devtype) {
--
1.7.2.5
next prev parent reply other threads:[~2013-09-09 15:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-09 15:55 [PATCH 0/5] i2c: rcar: Device Tree support and clock improvements Guennadi Liakhovetski
2013-09-09 15:55 ` [PATCH 1/5] i2c: rcar: (cosmetic) remove superfluous parenthesis Guennadi Liakhovetski
2013-09-09 15:55 ` [PATCH 3/5] i2c: rcar: add Device Tree support Guennadi Liakhovetski
2013-09-10 22:40 ` Magnus Damm
[not found] ` <CANqRtoTrCwd=+m6SPO2TqvvSjEO-m4uMrChxSYs_ZxniA-7dwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-10 22:46 ` Laurent Pinchart
2013-09-10 22:49 ` Magnus Damm
2013-09-11 7:37 ` Guennadi Liakhovetski
2013-09-09 15:55 ` Guennadi Liakhovetski [this message]
[not found] ` <1378742120-11135-1-git-send-email-g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>
2013-09-09 15:55 ` [PATCH 2/5] i2c: rcar: get clock rate only once and simplify calculation Guennadi Liakhovetski
2013-09-10 22:37 ` Magnus Damm
[not found] ` <CANqRtoRF8CD4hO4m23dqAtNCKvAqHo-+JhZud43SYePB4w5Ong-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-11 7:03 ` Guennadi Liakhovetski
2013-09-09 15:55 ` [PATCH 5/5] i2c: rcar: use per-device clock Guennadi Liakhovetski
[not found] ` <1378742120-11135-6-git-send-email-g.liakhovetski-Mmb7MZpHnFY@public.gmane.org>
2013-09-10 22:44 ` Magnus Damm
2013-09-11 7:20 ` Guennadi Liakhovetski
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=1378742120-11135-5-git-send-email-g.liakhovetski@gmx.de \
--to=g.liakhovetski@gmx.de \
--cc=devicetree@vger.kernel.org \
--cc=g.liakhovetski+renesas@gmail.com \
--cc=grant.likely@linaro.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=rob.herring@calxeda.com \
--cc=wsa@the-dreams.de \
/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;
as well as URLs for NNTP newsgroup(s).