Skip to content

Commit e2062df

Browse files
Zhang Qilongwsakernel
authored andcommitted
i2c: davinci: fix PM disable depth imbalance in davinci_i2c_probe
The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Fixes: 17f8815 ("i2c: davinci: Add PM Runtime Support") Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 367d4c8 commit e2062df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/i2c/busses/i2c-davinci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
823823
r = pm_runtime_resume_and_get(dev->dev);
824824
if (r < 0) {
825825
dev_err(dev->dev, "failed to runtime_get device: %d\n", r);
826-
return r;
826+
goto err_pm;
827827
}
828828

829829
i2c_davinci_init(dev);
@@ -882,6 +882,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
882882
err_unuse_clocks:
883883
pm_runtime_dont_use_autosuspend(dev->dev);
884884
pm_runtime_put_sync(dev->dev);
885+
err_pm:
885886
pm_runtime_disable(dev->dev);
886887

887888
return r;

0 commit comments

Comments
 (0)