Skip to content

Commit

Permalink
I2C: OMAP: xfer: fix runtime PM get/put balance on error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kevin Hilman authored and Wolfram Sang committed Aug 18, 2012
1 parent b007a3e commit 33ec5e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 33ec5e8

Please sign in to comment.