linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: TAD: Fix reference imbalance in acpi_tad_probe
@ 2020-11-14 11:18 Zhang Qilong
  2020-11-16  1:40 ` Hanjun Guo
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Qilong @ 2020-11-14 11:18 UTC (permalink / raw)
  To: rjw, lenb; +Cc: linux-acpi

It have enabled runtime and suspend the device before going
to fail branch. We should call pm_runtime_resume to keep the
usage counter balanced and pm_runtime_disable to keep disable
depth balanced sequentially.

Fixes: 95c513ec84f7f ("ACPI: Add Time and Alarm Device (TAD) driver")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/acpi/acpi_tad.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/acpi/acpi_tad.c b/drivers/acpi/acpi_tad.c
index 7d45cce0c3c1..87ab606a0df8 100644
--- a/drivers/acpi/acpi_tad.c
+++ b/drivers/acpi/acpi_tad.c
@@ -652,6 +652,8 @@ static int acpi_tad_probe(struct platform_device *pdev)
 	return 0;
 
 fail:
+	pm_runtime_resume(dev);
+	pm_runtime_disable(dev);
 	acpi_tad_remove(pdev);
 	return ret;
 }
-- 
2.25.4


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

* Re: [PATCH] ACPI: TAD: Fix reference imbalance in acpi_tad_probe
  2020-11-14 11:18 [PATCH] ACPI: TAD: Fix reference imbalance in acpi_tad_probe Zhang Qilong
@ 2020-11-16  1:40 ` Hanjun Guo
  0 siblings, 0 replies; 2+ messages in thread
From: Hanjun Guo @ 2020-11-16  1:40 UTC (permalink / raw)
  To: Zhang Qilong, rjw, lenb; +Cc: linux-acpi

On 2020/11/14 19:18, Zhang Qilong wrote:
> It have enabled runtime and suspend the device before going
> to fail branch. We should call pm_runtime_resume to keep the
> usage counter balanced and pm_runtime_disable to keep disable
> depth balanced sequentially.
> 
> Fixes: 95c513ec84f7f ("ACPI: Add Time and Alarm Device (TAD) driver")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
>   drivers/acpi/acpi_tad.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/acpi_tad.c b/drivers/acpi/acpi_tad.c
> index 7d45cce0c3c1..87ab606a0df8 100644
> --- a/drivers/acpi/acpi_tad.c
> +++ b/drivers/acpi/acpi_tad.c
> @@ -652,6 +652,8 @@ static int acpi_tad_probe(struct platform_device *pdev)
>   	return 0;
>   
>   fail:
> +	pm_runtime_resume(dev);
> +	pm_runtime_disable(dev);
>   	acpi_tad_remove(pdev);

acpi_tad_remove() did that job, so it's duplicate and wrong to add those
two function call I think.

Thanks
Hanjun

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

end of thread, other threads:[~2020-11-16  1:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-14 11:18 [PATCH] ACPI: TAD: Fix reference imbalance in acpi_tad_probe Zhang Qilong
2020-11-16  1:40 ` Hanjun Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).