* [PATCH v2] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
@ 2023-01-05 6:10 Liang He
2023-01-05 9:43 ` Charles Keepax
2023-01-19 20:57 ` Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Liang He @ 2023-01-05 6:10 UTC (permalink / raw)
To: lee, ckeepax, patches, windhl; +Cc: linux-kernel
In arizona_clk32k_enable(), we should use pm_runtime_resume_and_get()
as pm_runtime_get_sync() will increase the refcnt even when it
returns an error.
Signed-off-by: Liang He <windhl@126.com>
---
changelog:
v1: add missing pm_runtime_put_sync()
v2: use pm_runtime_resume_and_get()
drivers/mfd/arizona-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index cbf1dd90b70d..b1c53e040771 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -45,7 +45,7 @@ int arizona_clk32k_enable(struct arizona *arizona)
if (arizona->clk32k_ref == 1) {
switch (arizona->pdata.clk32k_src) {
case ARIZONA_32KZ_MCLK1:
- ret = pm_runtime_get_sync(arizona->dev);
+ ret = pm_runtime_resume_and_get(arizona->dev);
if (ret != 0)
goto err_ref;
ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
2023-01-05 6:10 [PATCH v2] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak Liang He
@ 2023-01-05 9:43 ` Charles Keepax
2023-01-19 20:57 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2023-01-05 9:43 UTC (permalink / raw)
To: Liang He; +Cc: lee, patches, linux-kernel
On Thu, Jan 05, 2023 at 02:10:55PM +0800, Liang He wrote:
> In arizona_clk32k_enable(), we should use pm_runtime_resume_and_get()
> as pm_runtime_get_sync() will increase the refcnt even when it
> returns an error.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
2023-01-05 6:10 [PATCH v2] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak Liang He
2023-01-05 9:43 ` Charles Keepax
@ 2023-01-19 20:57 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2023-01-19 20:57 UTC (permalink / raw)
To: Liang He; +Cc: ckeepax, patches, linux-kernel
On Thu, 05 Jan 2023, Liang He wrote:
> In arizona_clk32k_enable(), we should use pm_runtime_resume_and_get()
> as pm_runtime_get_sync() will increase the refcnt even when it
> returns an error.
>
> Signed-off-by: Liang He <windhl@126.com>
> ---
> changelog:
> v1: add missing pm_runtime_put_sync()
> v2: use pm_runtime_resume_and_get()
>
> drivers/mfd/arizona-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-20 4:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05 6:10 [PATCH v2] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak Liang He
2023-01-05 9:43 ` Charles Keepax
2023-01-19 20:57 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox