[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240809094900.j5c2q6gm72ycheeu@lcpd911>
Date: Fri, 9 Aug 2024 15:19:00 +0530
From: Dhruva Gole <d-gole@...com>
To: Dikshita Agarwal <quic_dikshita@...cinc.com>
CC: "Rafael J. Wysocki" <rafael@...nel.org>, Pavel Machek <pavel@....cz>,
Len
Brown <len.brown@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Stanimir Varbanov <stanimir.k.varbanov@...il.com>,
Vikash Garodia
<quic_vgarodia@...cinc.com>,
Bjorn Andersson <andersson@...nel.org>,
Konrad
Dybcio <konrad.dybcio@...aro.org>,
Mauro Carvalho Chehab
<mchehab@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
"Bryan O'Donoghue"
<bryan.odonoghue@...aro.org>,
<linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-media@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] PM: domains: add device managed version of
dev_pm_domain_attach|detach_list()
Hi,
On Aug 09, 2024 at 14:57:11 +0530, Dikshita Agarwal wrote:
>
>
> On 8/9/2024 9:49 AM, Dhruva Gole wrote:
> > Hi,
> >
> > On Aug 08, 2024 at 16:29:12 +0530, Dikshita Agarwal wrote:
> >>
> >>
> >> On 8/8/2024 4:25 PM, Dikshita Agarwal wrote:
> >>>
> >>>
> >>> On 8/8/2024 4:11 PM, Dhruva Gole wrote:
> >>>> On Aug 07, 2024 at 12:45:46 +0530, Dikshita Agarwal wrote:
> >>>>> Add the devres-enabled version of dev_pm_domain_attach|detach_list.
> >>>>> If client drivers use devm_pm_domain_attach_list() to attach the
> >>>>> PM domains, devm_pm_domain_detach_list() will be invoked implicitly
> >>>>> during remove phase.
> >>>>>
> >>>>> Signed-off-by: Dikshita Agarwal <quic_dikshita@...cinc.com>
> >>>>> ---
> >>>>> drivers/base/power/common.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
> >>>>> include/linux/pm_domain.h | 13 +++++++++++++
> >>>>> 2 files changed, 57 insertions(+)
> >>>>>
> >>>>> diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
> >>>>> index 327d168..729d6c2 100644
> >>>>> --- a/drivers/base/power/common.c
> >>>>> +++ b/drivers/base/power/common.c
> >>>>> @@ -277,6 +277,50 @@ int dev_pm_domain_attach_list(struct device *dev,
> >>>>> EXPORT_SYMBOL_GPL(dev_pm_domain_attach_list);
> >>>>>
> >>>>> /**
> >>>>> + * devm_pm_domain_detach_list - devres-enabled version of dev_pm_domain_detach_list.
> >>>>> + * @_list: The list of PM domains to detach.
> >>>>> + *
> >>>>> + * This function reverse the actions from devm_pm_domain_attach_list().
> >>>>> + * it will be invoked during the remove phase from drivers implicitly if driver
> >>>>> + * uses devm_pm_domain_attach_list() to attach the PM domains.
> >>>>> + */
> >>>>> +void devm_pm_domain_detach_list(void *_list)
> >
> > My problem is with the type of parameter used being void, why void?
> > Why not be explicit about it and call it dev_pm_domain_list *list like
> > the non-devres version of the API?
> >
> devm_add_action_or_reset API expects the argument as void (*)(void *).
>
> Below are code references following the same way:
> https://elixir.bootlin.com/linux/v6.11-rc2/source/drivers/devfreq/devfreq.c#L1332
> https://elixir.bootlin.com/linux/v6.11-rc2/source/drivers/clk/clk.c#L1033
>
> If I change the type of argument as you are suggesting, it will throw
> compilation error.
> "expected 'void (*)(void *)' but argument is of type 'void (*)(struct
> dev_pm_domain_list *)'"
Ah yes sorry I missed the devm_add_action_or_reset part. Thanks for clarifying!
--
Best regards,
Dhruva Gole <d-gole@...com>
Powered by blists - more mailing lists