public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] i2c: davinci: fix PM disable depth imbalance in davinci_i2c_probe
@ 2022-09-29 14:30 Zhang Qilong
  2022-10-01 22:47 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Qilong @ 2022-09-29 14:30 UTC (permalink / raw)
  To: nsekhar, brgl; +Cc: linux-i2c

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:17f88151ff190 ("i2c: davinci: Add PM Runtime Support")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 drivers/i2c/busses/i2c-davinci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 471c47db546b..c836cf884185 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] i2c: davinci: fix PM disable depth imbalance in davinci_i2c_probe
  2022-09-29 14:30 [PATCH v2] i2c: davinci: fix PM disable depth imbalance in davinci_i2c_probe Zhang Qilong
@ 2022-10-01 22:47 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2022-10-01 22:47 UTC (permalink / raw)
  To: Zhang Qilong; +Cc: nsekhar, brgl, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]

On Thu, Sep 29, 2022 at 10:30:38PM +0800, Zhang Qilong wrote:
> 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:17f88151ff190 ("i2c: davinci: Add PM Runtime Support")

Space is missing after ':'. I fixed it for you this time.

> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-01 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-29 14:30 [PATCH v2] i2c: davinci: fix PM disable depth imbalance in davinci_i2c_probe Zhang Qilong
2022-10-01 22:47 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox