]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
I2C: OMAP: xfer: fix runtime PM get/put balance on error
authorKevin Hilman <khilman@ti.com>
Wed, 27 Jun 2012 01:45:32 +0000 (18:45 -0700)
committerWolfram Sang <w.sang@pengutronix.de>
Sat, 18 Aug 2012 08:11:44 +0000 (10:11 +0200)
In omap_i2c_xfer(), ensure pm_runtime_put() is called, even on
failure.

Without this, after a failed xfer, the runtime PM usecount will have
been incremented, but not decremented causing the usecount to never
reach zero after a failure.  This keeps the device always runtime PM
enabled which keeps the enclosing power domain active, and prevents
full-chip retention/off from happening during idle.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Reviewed-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
drivers/i2c/busses/i2c-omap.c

index 6849635b268a81fe8f85d380d2d80d16ba6ab2b1..5d19a49803c152089c85b5b51c4d83cbb7a91cda 100644 (file)
@@ -584,7 +584,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 
        r = pm_runtime_get_sync(dev->dev);
        if (IS_ERR_VALUE(r))
-               return r;
+               goto out;
 
        r = omap_i2c_wait_for_bb(dev);
        if (r < 0)