]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
i2c: rcar: fix clk_get() error handling
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Thu, 12 Sep 2013 12:36:47 +0000 (14:36 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 30 Sep 2013 04:02:32 +0000 (06:02 +0200)
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>
drivers/i2c/busses/i2c-rcar.c

index 1f285a3be5c558d9b685be6f9b84592da84841cb..98276eb5f6e7d5928ee6789ab6fd6f81a7e5f111 100644 (file)
@@ -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) {