ASoC: rockchip: i2s_tdm: fix runtime pm imbalance on error
Subsystems (4)
PATCH 1/1 ASoC: rockchip: i2s_tdm: fix runtime pm imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced.
Signed-off-by Zhen Ni <[email protected]>
--- sound/soc/rockchip/rockchip_i2s_tdm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/rockchip/rockchip_i2s_tdm.c +3 -1
@@ -1739,8 +1739,10 @@ static int __maybe_unused rockchip_i2s_tdm_resume(struct device *dev)int ret; ret =pm_runtime_get_sync (dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put (dev);return ret; + } ret =regcache_sync (i2s_tdm->regmap);pm_runtime_put (dev);
Signature · 1 line
2.20.1
Quoted 6 lines · Zhen Ni
pm_runtime_get_sync()increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced.Signed-off-by Zhen Ni <[email protected]>
Better to use a new function pm_runtime_resume_and_get().
thanks,
Takashi
Quoted 25 lines
--- sound/soc/rockchip/rockchip_i2s_tdm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)sound/soc/rockchip/rockchip_i2s_tdm.c +3
-1@@ -1739,8 +1739,10 @@ static int __maybe_unused rockchip_i2s_tdm_resume(struct device *dev)int ret; ret =pm_runtime_get_sync (dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put (dev);return ret; + } ret =regcache_sync (i2s_tdm->regmap);pm_runtime_put (dev);Signature · 1 line
2.20.1