Commit e2062df7 authored by Zhang Qilong's avatar Zhang Qilong Committed by Wolfram Sang
Browse files

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: 17f88151 ("i2c: davinci: Add PM Runtime Support")
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 367d4c88
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -823,7 +823,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
	r = pm_runtime_resume_and_get(dev->dev);
	if (r < 0) {
		dev_err(dev->dev, "failed to runtime_get device: %d\n", r);
		return r;
		goto err_pm;
	}

	i2c_davinci_init(dev);
@@ -882,6 +882,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
err_unuse_clocks:
	pm_runtime_dont_use_autosuspend(dev->dev);
	pm_runtime_put_sync(dev->dev);
err_pm:
	pm_runtime_disable(dev->dev);

	return r;