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 <khilman@ti.com>
Reviewed-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
This commit is contained in:
Kevin Hilman 2012-06-26 18:45:32 -07:00 коммит произвёл Wolfram Sang
Родитель b007a3ef95
Коммит 33ec5e818b
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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)