From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8D8D35B636 for ; Mon, 23 Feb 2026 10:06:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771841204; cv=none; b=VqGIwXXolXNG69bpFsDf30lpwrpz1ZHN2VTyhgGNemeYM8HTe8vXGzA73HGV9O3LD1WkSDjxLOI6LApRrNUtDOkJtGQ6f7dsB0OSnt2pHZ3jkzTPxSS2FiiMlEqAtY5D+MLZ32msx7eErn82lUK/O1DFwnZnQX6hqcucCf6uHbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771841204; c=relaxed/simple; bh=Ls9/mxstBPiUscJXanhNIGaakaOL37aOeasQtK3uihk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FoVVaTdDon+j+7eIFrJ8ev/twFOik9neZt10MkHQuTzpnD2w+h4my8ngvOTkaN+4WInpGEQL2q3ajk6oYLHEjpTn3sTnN/iXhCqXPL8tk3pWrwdqo4p1d0d2tjgi5sMX0ICsnGmtRQipiQjV5fc4KIJSgBYZHrMsToXjTp8kSKA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Ms6y54JB; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=a/+hjpE+; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Ms6y54JB"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="a/+hjpE+" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61MMQdFo3552830 for ; Mon, 23 Feb 2026 10:06:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Hf+hf6kFRl7RMaYp5pixwnMILTepD9GtbgC8b6qoZjc=; b=Ms6y54JB2MTLD9Cm eir0fCQ9yueOxyrse+72M0zfjF6++PdoIqX+h5GkDukxJiLSg9qc4xiQKpmgZ9ka cN5L0V3/eE2bvibkQENpCxrO8+ZGRvuyUfsu39wgc7A2md6+JBwIFsA+WUYk0QX/ nqNU6qKYoGkUr/jadfCls0PbUDk3H8fSfS714e0//W35dBJo2EoW8KIkBnEmCm7m Bi3xNMLfltrdaKQQwKt5uWxTkHzNyZJqSG4XFsLOMEGjVDt1TrvJNpVLqdI1ds7w BMk+upHMg2nINzK2iz95aB/3m+PZRsQ/ZQ7C7Q0DapPre8rqOFS5lHAaG5u/qUsd L5qpPA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cf5u8m8m1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 23 Feb 2026 10:06:41 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8ca3ef536ddso5137037485a.0 for ; Mon, 23 Feb 2026 02:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771841201; x=1772446001; 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=Hf+hf6kFRl7RMaYp5pixwnMILTepD9GtbgC8b6qoZjc=; b=a/+hjpE+U5v5HWLmZAq9u1GnPMbbLH45nZ1RYaULaceMWYRR7b5GGt1wJDXfJkOEAb KeKaGIKK536lCzsneMkY3Zb4MTrxlPKvon+KRV2L+kyxGv7uxc1se1y93awrGahpjnvP thYQssKyyYqmBFhZd2sCnQLGqJLmoF8K3hk4mwx4ECOI5nStKG91Av9FfpxXKBZNm9AP KY9kR/NQPj+b6LYXKhUUTG4CQAWNJ74H61Uigm8kTp99UySFaCm0i+fdeRpfOX5H6gkz 72Uk091JhaTUWOFXne3yFoKw3ZpvJIphsUlqNXCfll11OWRV/7/N6jyNcv1pmV6wmj/M x2vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771841201; x=1772446001; 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=Hf+hf6kFRl7RMaYp5pixwnMILTepD9GtbgC8b6qoZjc=; b=SUXh+JB+ma4Ji4V0kzpfYN8v2WVS/C5CL9eg8+8ry/4DgFMoKPtQL7w0buGXZayP0y TPr+ruqQTcHKMJdqOpldPH/aXhNaHpBDkuk4hDbYKxIuDjygL11On4TqMhX/0+IHU6uY Kx9Dj9/moNM7E7LUwmgfw3iFp5XlKu47TsvgKOZoNYWBixn3eZcLkScmy9RQfjgv08JP fg3oOvgsvfjWM07jqo1U776EApF8cNqzyHiYi5cHNH26WFY1/GGh3bChgJqcvhxtsxz7 mexf28GDYoSqIgilW6bDx7OrYBvW/fdhF7MZOs6AQg2677jTGVw9ZSVGqK1UxP++r/5W q7vg== X-Gm-Message-State: AOJu0Yy4/ryjfJrcl/DEArsbHCQkDnkSuAMIyVdiSiKGQSe4WaJFKbeY V5KuLCKmbJNGN7GDGTOTrDSd6tka0/fKH2THIewl55Mvb1t1cz8JEUSzllpGyvi/Bm5C2NKVZkU 1mDpw/7X0oghjkDtXxAc43eHNEwHiYKB5gVanc46CYFuqR0EVYNGaBtyx6k5inIViCdbG7oz/QD I= X-Gm-Gg: AZuq6aLdYYc1T53B0IYUvulViHqfwqzWFx6scwYSFVhP/6ea7BBsWRpaLFC7IYoCAaY 4yOh0fgMWxWT4j8do09Ulf5y2fmlxBV1iHvTOZGGO0+YudEccwQE/ikxfzMgI5i4Hk05yB8PxdO 5vKddDSNaSqNv9lj3sgUJMfN+SwzAg7uSOw3j0bg3050mHDMY7PiAaTSOQAjh0Q+7hQLkXon61X vCMah5PPqatAEEkax5xqtUJQgdIkVPiLsdnhhb/ueR1ryj5ldIt6oaZcK0wKyibaTqs4eqvSO5z 3ViI0Z3vQco15F0STBATooXuRrXuygQTajAHMUh0HXKz9UEctUht7/ksSgHH1D7OM+P9UHuQYvB 5W90jVYNXkX7ssBLslKp0UJ9jKMM17cEycJraV9GJdd1yxGJtzKR9 X-Received: by 2002:a05:620a:1a9a:b0:8ca:4545:aedc with SMTP id af79cd13be357-8cb8ca0e852mr899480785a.36.1771841201082; Mon, 23 Feb 2026 02:06:41 -0800 (PST) X-Received: by 2002:a05:620a:1a9a:b0:8ca:4545:aedc with SMTP id af79cd13be357-8cb8ca0e852mr899478585a.36.1771841200586; Mon, 23 Feb 2026 02:06:40 -0800 (PST) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:bd71:422c:5e83:8b37]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d54760sm18288885f8f.35.2026.02.23.02.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 02:06:40 -0800 (PST) From: Bartosz Golaszewski Date: Mon, 23 Feb 2026 11:06:16 +0100 Subject: [PATCH v2 03/14] reset: gpio: simplify fallback device matching 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: 7bit Message-Id: <20260223-reset-core-refactor-v2-3-5e5a7289190c@oss.qualcomm.com> References: <20260223-reset-core-refactor-v2-0-5e5a7289190c@oss.qualcomm.com> In-Reply-To: <20260223-reset-core-refactor-v2-0-5e5a7289190c@oss.qualcomm.com> To: Krzysztof Kozlowski , Philipp Zabel Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4468; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=Ls9/mxstBPiUscJXanhNIGaakaOL37aOeasQtK3uihk=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpnCaiq9ZC02q3p+YbMjgfrcFfr0wvskISl6p5e br91EGgHc+JAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCaZwmogAKCRAFnS7L/zaE w3C7D/0UUTnRgbjqj/QmyW0khlqmdgrbSgH4s8+lp7UJR89BvA1vUOCXJ3IO+9Szs0vHkqWsac3 fM22+7U2LWujPrlan8BcAFcuYj7+voeMdurQhWSLSFf3jTVYgFxb4800Z7maV7rVD/kSSvcrshz 53QUrbYR+fTumER1laEQt8AGswbgjbe0WUdreCut2S9DNEiTVhWVnmcT5Iy3bECpgBAr063deW4 a/KZcGUbXgARSWkrEs3KCImEL/5qvhpoEOnZhdXsEDbri/15hLgtURipBkRQYetfXLm4DzmWuag gDu1VHK8MWhAcM4VOZL2CBp348CfDr3RxstyGubVNQmNinEnjf11yZC83iW2E5RwOsattSRZoF/ c6xUAJGLRThjX5LcFc1AgCWbR/L4+VnV+k157QjUFB9ooLQdt/kA3e8FmkoZSysSj50XxTts851 dTxY+3EL0d5JTG8yaycIku6QRn8o2usLB3FBK9WXaZqqJOagnfKWuErNzrQ89v1ios8TUJEs0ZF 2VZsriB+U+qdY8sTp/MQY8BacuYl5aHjq2hijAlf/DuDzuegwfcqeIfxL89mpmN7fKTf7m2xSIm /Csed5kAb1+151Up/RYzCa75OdmRB5L/E5pJ1hfdKCTY2eQqo6ZtUnp9cOQByjBmgmVeX6eRY/v 81+eDcszw6BLDZA== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-GUID: jhDpAC-kalqyppsdhiXv0n4qyde8z_bN X-Authority-Analysis: v=2.4 cv=cJftc1eN c=1 sm=1 tr=0 ts=699c26b1 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=C-6xm7Ge3zJZVfUZFQkA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-ORIG-GUID: jhDpAC-kalqyppsdhiXv0n4qyde8z_bN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIzMDA4NiBTYWx0ZWRfXzJAIeTWURwot FVhMSL6xQWINuyrBdLtQCeV2dCvT1feduo0WWjOZFAdUiE3CoXW8nb4Vaj5u8wBGzTigby9d8B4 j5oyv8dnk9n+ejMf8aijXLiVscVpkQ6u3rXksMhTOHq+bEzJCpT3ZS7QgU2a3gcHl2HuGN4US8K qjEcoSK/hPFPuFAwb6V29hByVGRYD4ZMMteJOoN/KPmuOnoTsGu4P0cuzHHpOvK0kVteKyXO7IW WI+2lXrIxO9yqL9E0MHU4SQvqaxje+tKu6jPzTa8/e8F/yp8Mrz8G+Ckz74440m4HPtgnV/QB+d YXIVM+sMRkXtcGOXIVUmuFhjzC80aGAtRiHcz0WIoXi4WLgWTZnjl9f3rNh4DmmuKcyiY6UcaWm G9b6kcsxhgP66pItgw95nT8p612WPSU41GGY4M84hjTSRl+W6N7JGG4GGLFqhA+hE+yTj5TbqDP I1uke+QZTsJmULSKRfQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-23_02,2026-02-20_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 clxscore=1015 malwarescore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2602230086 The of_args field of struct reset_controller_dev was introduced to allow the reset-gpio driver to pass the phandle arguments back to reset core. The thing is: it doesn't even have to do it. The core sets the platform data of the auxiliary device *AND* has access to it later on during the lookup. This means the field is unneeded and all can happen entirely in reset core. Remove the field from the public header and don't set it in reset-gpio.c. Retrieve the platform data in reset core when needed instead. Signed-off-by: Bartosz Golaszewski --- drivers/reset/core.c | 15 ++++++--------- drivers/reset/reset-gpio.c | 5 ----- include/linux/reset-controller.h | 4 ---- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/reset/core.c b/drivers/reset/core.c index 3845e77a8d32bf615c9d430847b497af0ba374ad..954df36a242e804b639027384700b8d988be0e90 100644 --- a/drivers/reset/core.c +++ b/drivers/reset/core.c @@ -94,9 +94,6 @@ static const char *rcdev_name(struct reset_controller_dev *rcdev) if (rcdev->of_node) return rcdev->of_node->full_name; - if (rcdev->of_args) - return rcdev->of_args->np->full_name; - return NULL; } @@ -125,9 +122,6 @@ static int of_reset_simple_xlate(struct reset_controller_dev *rcdev, */ int reset_controller_register(struct reset_controller_dev *rcdev) { - if (rcdev->of_node && rcdev->of_args) - return -EINVAL; - if (!rcdev->of_xlate) { rcdev->of_reset_n_cells = 1; rcdev->of_xlate = of_reset_simple_xlate; @@ -1006,13 +1000,16 @@ static struct reset_controller_dev *__reset_find_rcdev(const struct of_phandle_a bool gpio_fallback) { struct reset_controller_dev *rcdev; + struct of_phandle_args *rc_args; lockdep_assert_held(&reset_list_mutex); list_for_each_entry(rcdev, &reset_controller_list, list) { - if (gpio_fallback) { - if (rcdev->of_args && of_phandle_args_equal(args, - rcdev->of_args)) + if (gpio_fallback && rcdev->dev && + device_is_compatible(rcdev->dev, "reset-gpio")) { + rc_args = dev_get_platdata(rcdev->dev); + + if (of_phandle_args_equal(args, rc_args)) return rcdev; } else { if (args->np == rcdev->of_node) diff --git a/drivers/reset/reset-gpio.c b/drivers/reset/reset-gpio.c index ad5bfe27aaef7de57f9566330253333aa2b1253f..6e1c4f990bc0e54f4a47186340cef03b1a2ee29b 100644 --- a/drivers/reset/reset-gpio.c +++ b/drivers/reset/reset-gpio.c @@ -56,12 +56,8 @@ static int reset_gpio_probe(struct auxiliary_device *adev, const struct auxiliary_device_id *id) { struct device *dev = &adev->dev; - struct of_phandle_args *platdata = dev_get_platdata(dev); struct reset_gpio_priv *priv; - if (!platdata) - return -EINVAL; - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; @@ -76,7 +72,6 @@ static int reset_gpio_probe(struct auxiliary_device *adev, priv->rc.ops = &reset_gpio_ops; priv->rc.owner = THIS_MODULE; priv->rc.dev = dev; - priv->rc.of_args = platdata; /* Cells to match GPIO specifier, but it's not really used */ priv->rc.of_reset_n_cells = 2; diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h index 46514cb1b9e0626872fe71357b24d54ff0e81a8b..aa95b460fdf86f10002a465e285cd0119da6eeaf 100644 --- a/include/linux/reset-controller.h +++ b/include/linux/reset-controller.h @@ -35,9 +35,6 @@ struct of_phandle_args; * @reset_control_head: head of internal list of requested reset controls * @dev: corresponding driver model device struct * @of_node: corresponding device tree node as phandle target - * @of_args: for reset-gpios controllers: corresponding phandle args with - * of_node and GPIO number complementing of_node; either this or - * of_node should be present * @of_reset_n_cells: number of cells in reset line specifiers * @of_xlate: translation function to translate from specifier as found in the * device tree to id as given to the reset control ops, defaults @@ -51,7 +48,6 @@ struct reset_controller_dev { struct list_head reset_control_head; struct device *dev; struct device_node *of_node; - const struct of_phandle_args *of_args; int of_reset_n_cells; int (*of_xlate)(struct reset_controller_dev *rcdev, const struct of_phandle_args *reset_spec); -- 2.47.3