phy: phy-core: increment refcounting variables only on 'success'
authorKishon Vijay Abraham I <kishon@ti.com>
Fri, 20 Dec 2013 05:06:49 +0000 (10:36 +0530)
committerKishon Vijay Abraham I <kishon@ti.com>
Tue, 24 Dec 2013 18:22:58 +0000 (23:52 +0530)
commit637d378cea0b463c466a61a6564cdd541d689af5
tree51cb3c6ca847c33d0305547ba2b1f21d47759ff8
parentcedb7f89d1e1f631b7e5d920fe1ea7f742d07f79
phy: phy-core: increment refcounting variables only on 'success'

Increment 'init_count' only if the 'init' callback succeeded and decrement
'init_count' only if the 'exit' callback succeded. Increment 'power_count'
only if 'power_on' callback succeded and if it failed disable the clocks using
phy_pm_runtime_put_sync(). Also decrement 'power_count' only if 'power_off'
callback succeded and if it failed do not disable the clocks.

Reported-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-core.c