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)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:45 +0000 (11:47 +0900)
commit9334e7d77ebedc2990e29068041e61fa55f3b64a
tree2fe55f79dd45cfcc936d4ac108a472511df30823
parentb56d2f2a6e009fe3015afc856e844d79494b47a9
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>
[backport from upstream commit 637d378cea0b463c466a61a6564cdd541d689af5]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I482404787fa520568d365fbc39ab81d812689f20
drivers/phy/phy-core.c