diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-09-12 14:36:47 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2013-09-30 06:02:32 +0200 |
commit | 330c824a49cd49dd7e61c1e397fa4e7380ba2c68 (patch) | |
tree | 16dd3037e788135f53b78ff6eac04ed6a38d4977 /drivers/i2c | |
parent | 7679c0e19120ee7839adf1f05904cbfcc7a7c2b9 (diff) |
i2c: rcar: fix clk_get() error handling
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>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | 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 1f285a3be5c5..98276eb5f6e7 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) { |