Skip to content

Commit 33ec5e8

Browse files
Kevin HilmanWolfram Sang
authored andcommitted
I2C: OMAP: xfer: fix runtime PM get/put balance on error
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 <[email protected]> Reviewed-by: Shubhrajyoti D <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent b007a3e commit 33ec5e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-omap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
584584

585585
r = pm_runtime_get_sync(dev->dev);
586586
if (IS_ERR_VALUE(r))
587-
return r;
587+
goto out;
588588

589589
r = omap_i2c_wait_for_bb(dev);
590590
if (r < 0)

0 commit comments

Comments
 (0)