Linux Power Management development
 help / color / mirror / Atom feed
From: Georgi Djakov <djakov@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>,
	Luca Weiss <luca.weiss@fairphone.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Mike Tipton <mike.tipton@oss.qualcomm.com>,
	Taniya Das <taniya.das@oss.qualcomm.com>,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Subject: Re: [PATCH v2 1/5] interconnect: Add devm_of_icc_get_by_index() as exported API for users
Date: Sat, 9 May 2026 01:14:01 +0300	[thread overview]
Message-ID: <0c116b90-1688-49f6-b97f-fbe78466221f@kernel.org> (raw)
In-Reply-To: <af08-zMGzSSsw_NR@baldur>

On 5/8/26 4:32 AM, Bjorn Andersson wrote:
> On Fri, May 01, 2026 at 11:18:29AM +0200, Luca Weiss wrote:
>> Users can use devm version of of_icc_get_by_index() to benefit from
>> automatic resource release.
>>
>> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> 
> Georgi, can I have an ack on this, or an immutable branch and a ping
> once it's available?

Hi Bjorn, please apply it.

Acked-by: Georgi Djakov <djakov@kernel.org>

Thanks,
Georgi
> 
> Thanks,
> Bjorn
> 
>> ---
>>   drivers/interconnect/core.c  | 20 ++++++++++++++++++++
>>   include/linux/interconnect.h |  6 ++++++
>>   2 files changed, 26 insertions(+)
>>
>> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
>> index 8569b78a1851..bc2e416dbcb2 100644
>> --- a/drivers/interconnect/core.c
>> +++ b/drivers/interconnect/core.c
>> @@ -443,6 +443,26 @@ struct icc_path *devm_of_icc_get(struct device *dev, const char *name)
>>   }
>>   EXPORT_SYMBOL_GPL(devm_of_icc_get);
>>   
>> +struct icc_path *devm_of_icc_get_by_index(struct device *dev, int idx)
>> +{
>> +	struct icc_path **ptr, *path;
>> +
>> +	ptr = devres_alloc(devm_icc_release, sizeof(*ptr), GFP_KERNEL);
>> +	if (!ptr)
>> +		return ERR_PTR(-ENOMEM);
>> +
>> +	path = of_icc_get_by_index(dev, idx);
>> +	if (!IS_ERR(path)) {
>> +		*ptr = path;
>> +		devres_add(dev, ptr);
>> +	} else {
>> +		devres_free(ptr);
>> +	}
>> +
>> +	return path;
>> +}
>> +EXPORT_SYMBOL_GPL(devm_of_icc_get_by_index);
>> +
>>   /**
>>    * of_icc_get_by_index() - get a path handle from a DT node based on index
>>    * @dev: device pointer for the consumer device
>> diff --git a/include/linux/interconnect.h b/include/linux/interconnect.h
>> index 4b12821528a6..75a32ad0482e 100644
>> --- a/include/linux/interconnect.h
>> +++ b/include/linux/interconnect.h
>> @@ -47,6 +47,7 @@ struct icc_path *of_icc_get(struct device *dev, const char *name);
>>   struct icc_path *devm_of_icc_get(struct device *dev, const char *name);
>>   int devm_of_icc_bulk_get(struct device *dev, int num_paths, struct icc_bulk_data *paths);
>>   struct icc_path *of_icc_get_by_index(struct device *dev, int idx);
>> +struct icc_path *devm_of_icc_get_by_index(struct device *dev, int idx);
>>   void icc_put(struct icc_path *path);
>>   int icc_enable(struct icc_path *path);
>>   int icc_disable(struct icc_path *path);
>> @@ -79,6 +80,11 @@ static inline struct icc_path *of_icc_get_by_index(struct device *dev, int idx)
>>   	return NULL;
>>   }
>>   
>> +static inline struct icc_path *devm_of_icc_get_by_index(struct device *dev, int idx)
>> +{
>> +	return NULL;
>> +}
>> +
>>   static inline void icc_put(struct icc_path *path)
>>   {
>>   }
>>
>> -- 
>> 2.54.0
>>


  reply	other threads:[~2026-05-08 22:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-01  9:18 [PATCH v2 0/5] Support enabling interconnect path for GDSC for fixing Milos camcc Luca Weiss
2026-05-01  9:18 ` [PATCH v2 1/5] interconnect: Add devm_of_icc_get_by_index() as exported API for users Luca Weiss
2026-05-08  1:32   ` Bjorn Andersson
2026-05-08 22:14     ` Georgi Djakov [this message]
2026-05-01  9:18 ` [PATCH v2 2/5] dt-bindings: clock: qcom,milos-camcc: Document interconnect path Luca Weiss
2026-05-03 12:36   ` Krzysztof Kozlowski
2026-05-01  9:18 ` [PATCH v2 3/5] clk: qcom: gdsc: Support enabling interconnect path for power domain Luca Weiss
2026-05-01  9:18 ` [PATCH v2 4/5] clk: qcom: camcc-milos: Declare icc path dependency for CAMSS_TOP_GDSC Luca Weiss
2026-05-01  9:18 ` [PATCH v2 5/5] arm64: dts: qcom: milos: Add interconnects to camcc Luca Weiss
2026-05-04  8:01   ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0c116b90-1688-49f6-b97f-fbe78466221f@kernel.org \
    --to=djakov@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=mike.tipton@oss.qualcomm.com \
    --cc=mturquette@baylibre.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=taniya.das@oss.qualcomm.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox