From nobody Wed Feb 11 02:09:39 2026 Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 745512405EB for ; Fri, 16 Jan 2026 13:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768569448; cv=none; b=CBAEJCnU0LCoxOTXif3HtjRKQuBJT76MsVX99IZCJ/N4Y+zjkEzecH2HLnT+gCIobcIPaCM4LtbFOR1IHa1+oCtq67BOwDBKrPEiOZMlO2HI6qnXJFzjq+F2Yd03Zj4HX7ineqY85Kg0yFgejdoZndx7GudOJiN644dNVllx38M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768569448; c=relaxed/simple; bh=bCuXidJmykHrH5/xvuIi+xpUlM7CPaWZgEz+0RvmlPc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mjU5L5xzqG3pB/W62kJb2rRCzciyGNTrt2ogtJKbaq4Sof7wcUjrAIxAB7O78DHlz/sbXQYC92NkjbboG6ClDnuTfVBg1h+KsTeghTlEAk4X1iup/53kWTGO/YxuLLJToK1RkWx/R1PpYdPPQjgwuxN6B2CRr9EkRw9rjfZfnbU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=QTM7us57; arc=none smtp.client-ip=209.85.218.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="QTM7us57" Received: by mail-ej1-f66.google.com with SMTP id a640c23a62f3a-b8719aeebc8so377073366b.3 for ; Fri, 16 Jan 2026 05:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1768569445; x=1769174245; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dr1dBlLLfYPYJFN+bHMPl6dVd/Smnn8ihazbVyoDL5M=; b=QTM7us572usDv7AeGtPhpASxDmrX5F1AwqpHR7EV525CzknOU59DMIueJ8/VjToFvg cmEbT08FyE+QFpO1L9Pvc7OO3NSk18sq6LSW7yd8Nf3Qj74DrdbTeS9uwghxelNNCYj0 LERiEbgHdZYprYoKOvRSCBPRRWqDqk7SxWe7ek7yrWQibjUTKH4JbxkEzBSYQPgCJR4O hSko0JfMSbPqjMGtbQMmLTHXw5ji3D6rbmqiUg8GN6bFi+RSe5NxppaLXgyEIit8+M3/ Fz3LKIeuKHYXCi5e7rFp+NsStST4khP6gAaawa3qImFMxQgMtNl4cY7g4h47GulLih// n+1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768569445; x=1769174245; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dr1dBlLLfYPYJFN+bHMPl6dVd/Smnn8ihazbVyoDL5M=; b=aloWJMznq/EXOc+hoNNqIk9bC0seY8ib91uQli6jQT5v4SvdSwlvsidQq7JwGbd9uL 9m6YHTgPYjG1kD0qjbCz1C1q1XoT0tYEFMKQIrYFLhkxkiZEkLhJKyrVYp7JqaB08e7J L325rESHdhKSlJHVR60DwHCD5x4xd9LenLnipOR+QJO+MrH/KcO9ga1ycgeunTVEJpJ3 UlOkcGewXEqZUf1zAf2PXkGREQjtswAtm9WaW/KHbcsfju4bPAbNWajh3qjmLvKmBjJn 5a4KyrCNF5JxJfSVZMLHAmTmq4HNYO5M9hxAD+WUNqocH/tPzrDPm/Xt8gOYQ6b1/I/y cU9Q== X-Forwarded-Encrypted: i=1; AJvYcCXQ+WLsbg1Ntc66Jc0W+fuVw+c61RVzFppfyCRK2OjUGllYdCTrnhMAZtneCRa0T4DF1jUUhj33gqhBfcA=@vger.kernel.org X-Gm-Message-State: AOJu0YykjjUVTL+Kv9L4MbySdMOQLJTud9hASCZYIL+fMhmW3/1xHJfv tGEAjbWPWLFxeyAhkgB3e/PbXV/rC1jgGpCLqV7ZW1FRBRrl+ARmFiy2Ld0WbuQ6t8s= X-Gm-Gg: AY/fxX4iDgllUHAwGNEO/vp3btEbuzDkPADisjoiFHx7Fr39jnS3kz7qXwkh5tN035l xer3ghRqqpf4pz8sRFsbHspa0SzdOzMtTueUSqHTHJgrGCBojAdeo43Qqem/vRTvJ5LF6CUd46y 5mkdkS7y1/1vPu+4o0wOgTmcCA3b85h7dKiK3Q7WvsaQAPgdEyvS4B9Ycm1nXiuxclBXufOJ+M5 AeqUNP6ErxFqFtR/NiewAnVVTWYveaLUWpVbhW3hAEy39stRwtW/6NMVjh1iVcTuS7CEebWQlYQ 21/SB9+CCjjKvZVYKlvOCpH1NUsTOj/jEgm+yt8ZlWEVVccsX8+5LwuGh9YaXpaFGmOpOuJ32It 1fQVzFy/FJus7zO09JNtS/dLezJXTB0q+P0/7cC+EdzYf2LkJSHfErNCJwF6yLPH6DuI4dfYBhQ +2ALsQRTdorud5/qHwlEu7nxm6BGS0wRKIwCFdiS1Ut1RltIZTwlN2qAqmE49m38jq X-Received: by 2002:a17:907:1c09:b0:b83:f538:c2a6 with SMTP id a640c23a62f3a-b8792d273femr262706366b.6.1768569444776; Fri, 16 Jan 2026 05:17:24 -0800 (PST) Received: from [172.16.240.99] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8795a350dbsm235507366b.69.2026.01.16.05.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 05:17:24 -0800 (PST) From: Luca Weiss Date: Fri, 16 Jan 2026 14:17:20 +0100 Subject: [PATCH 1/5] interconnect: Add devm_of_icc_get_by_index() as exported API for users Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260116-milos-camcc-icc-v1-1-400b7fcd156a@fairphone.com> References: <20260116-milos-camcc-icc-v1-0-400b7fcd156a@fairphone.com> In-Reply-To: <20260116-milos-camcc-icc-v1-0-400b7fcd156a@fairphone.com> To: Georgi Djakov , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Konrad Dybcio Cc: ~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, Luca Weiss X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1768569443; l=2212; i=luca.weiss@fairphone.com; s=20250611; h=from:subject:message-id; bh=bCuXidJmykHrH5/xvuIi+xpUlM7CPaWZgEz+0RvmlPc=; b=gWnOVQzJkci4lXcmtXJVm6rHU7f4/LCiwxPAkRBMrt9HO3Y81FpwwOdbP5nuH44jBz3Bhr6mu g+++h/05vt9DCDUphmho3T0LS2WKvANznToIrzPt/SpmQ9c1vKStIai X-Developer-Key: i=luca.weiss@fairphone.com; a=ed25519; pk=O1aw+AAust5lEmgrNJ1Bs7PTY0fEsJm+mdkjExA69q8= Users can use devm version of of_icc_get_by_index() to benefit from automatic resource release. Signed-off-by: Luca Weiss Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- 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 6cc979b26151..2242554525df 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, c= onst char *name) } EXPORT_SYMBOL_GPL(devm_of_icc_get); =20 +struct icc_path *devm_of_icc_get_by_index(struct device *dev, int idx) +{ + struct icc_path **ptr, *path; + + ptr =3D devres_alloc(devm_icc_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return ERR_PTR(-ENOMEM); + + path =3D of_icc_get_by_index(dev, idx); + if (!IS_ERR(path)) { + *ptr =3D 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 cha= r *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_bul= k_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(struc= t device *dev, int idx) return NULL; } =20 +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) { } --=20 2.52.0