Commit aa57e77b authored by Zhang Qilong's avatar Zhang Qilong Committed by Sebastian Reichel

HSI: Fix PM usage counter unbalance in ssi_hw_init

pm_runtime_get_sync will increment pm usage counter
even it failed. Forgetting to putting operation will
result in reference leak here. We fix it by replacing
it with pm_runtime_resume_and_get to keep usage counter
balanced.

Fixes: b209e047 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 5c8fe583
...@@ -424,7 +424,7 @@ static int ssi_hw_init(struct hsi_controller *ssi) ...@@ -424,7 +424,7 @@ static int ssi_hw_init(struct hsi_controller *ssi)
struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi); struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi);
int err; int err;
err = pm_runtime_get_sync(ssi->device.parent); err = pm_runtime_resume_and_get(ssi->device.parent);
if (err < 0) { if (err < 0) {
dev_err(&ssi->device, "runtime PM failed %d\n", err); dev_err(&ssi->device, "runtime PM failed %d\n", err);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment