From nobody Tue Feb 10 22:17:41 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 44A8F30C625 for ; Mon, 19 Jan 2026 10:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768819236; cv=none; b=f5Z/t5oXrPkGQJEKkhyqHuKoffF+BRP5mUOUY1dK+fZkB43cRniomNe59yECdD+tEnvjSA45WaZW3+HvQkWhQbm2/54rwA9NuKs5rnN9ltT6pFbudeORMiJCX/DzGZISTNLlwp2HAgdWE9arsfnXbyo4NpNMkypakBmRF2q3vAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768819236; c=relaxed/simple; bh=PbFFIprfToa4la34wmCmAKivaJm7MBQFtk1XHPgSNcg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UoAQMHLSyYjGHn3UNhomBhurexIkhar9oT9tTjw8kZibo1xfHyKOyf1dzrWojVzqQ+i2QUsl/W0D+N26X2xR4eTfDxLGTTCu14YT4riwyag92lb77qV2PXniPZuoWs7EUnzgGzYQ9aGWXCB6qaqwbmguM6L54mgVUyNlDq8P9lU= 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=nmtXdM1L; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Djc5pMA1; arc=none smtp.client-ip=205.220.168.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="nmtXdM1L"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Djc5pMA1" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60J914rs1044553 for ; Mon, 19 Jan 2026 10:40:34 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= POgrLMWtUfchu0UFOuGxBxCFcPtR77HVdsAYnI4PI1M=; b=nmtXdM1LuG33ut1P Lm7V2f7hk5I3fLWZx2Ma8lcDJ7ZCrv9FdZ2ITnRIwFZ69CBPrK8bR+9cjP4R9Bs7 bufPn7Yp34AFajEbibFCHuZrxmHrVWMmetjBgVxqp5B4gzuTIbZBAmjc0PnLram/ Ce6P2kmISeTh741nUsPDtiv8x5EAdONn7emQ5zwDvgzCCrDP7+HHN+lhx46JmOM+ NLP2MQiy4QX7OB+ycHeaGn8hhKGe6AgKf9UydQ3PaM4zuyl5/kKOshVGJyMmTbxv fgKA/y5gjTZ5eV6RiYcjyiVvo8C4yICIccyZocLYI+R1c3XdWbUZ/LSiCoB1NOM5 WFgkfA== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bs79ehssv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 19 Jan 2026 10:40:34 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8c6a241b5cdso599628385a.1 for ; Mon, 19 Jan 2026 02:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768819234; x=1769424034; 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=POgrLMWtUfchu0UFOuGxBxCFcPtR77HVdsAYnI4PI1M=; b=Djc5pMA1UDkmAxlbW4PDmE5ftsWZYnNS7S2QZ6Efg9YSW/Bh4F40pu3oidsrMiwIZS fvgWuZGHWoj9v0UCYJrcXvjete63CrDDnJZS7LNKkzqifxgRZoazfHDMfT1nTt4qEHxg GyD3eJPxbTJ7G+45i3+CR1FyVKB+KzCGXTtCPZobQtE4OLOYYnUJomjMwAKA4U30sC3d QjAdqwSeair+K3HVLXAGk2aQpNifHX5g62m67VYwSyDKkxZV2pYzYs74Z9gjfhallFmE MSeuK0vS1VcNyHe95EjJxD1Md4SLFSb0PXkRKDFwiqjZcXim73bM4KzXxtQ3Z/9xm+IR enUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768819234; x=1769424034; 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=POgrLMWtUfchu0UFOuGxBxCFcPtR77HVdsAYnI4PI1M=; b=HPPGJB4oEBSe0YZonDd1DAFgmnPfZWFzgs/XsRUjppUuY8UnOP+T9Ito/f7P45iNXZ e6tCOnPvi6Zc6b0Ay49cVyNncSxr2ngOOqa6Q75XW3wEHvg4s9lTEt8AJL7cZ7Rk4QmZ 9pBYAKNn+ekhlaJqgJLmpksMEN9UV9OFfzYnP8LuCoM42OdbZa9CJv5mj6sNLe3/C3pM WRvs1O6AVe4yQMO30d7f8HLYtWMUE/T+c9OgrmidmB0NPA4tVw935+rVhu9XsPQEZqzN IjndmDsP2nL0HMH1riIpoYLUa13tgkzcbMinwWXZaE3fvKLYwm65BoioQQRPT0gm8V/l 4nXg== X-Forwarded-Encrypted: i=1; AJvYcCXMC1WxJhW26rb74GngEviMvyJhE6JQKqEjDblSMHjmbHvKo2oKWDFC+vEn30VowyCrkH6oEHfW8Igk3Uw=@vger.kernel.org X-Gm-Message-State: AOJu0YwscZquXdvj5+eM4y6X5KOlOkAglD6bGqqdkLQJz7QL7FeKzypZ 81iI1jQ9ErEt0w1hWw8Tp/+we2mY/kj+h7JZ6jVjztxRy0XcWnzbNrHCpuVzjqhttYgIQEvHCU2 NWSn29+BYWvggdUgYiltuPOx3VbCxXBCWqhYSNEycgxUC+Xw9zH4iGIoCB34CDCCIoh4= X-Gm-Gg: AY/fxX4uUQTKpWOaKM/DvZ8kDxcuj64Lmx7D84ME5kLdX0FfxKwCEGVEGaGSPiazGSK 1WWHSsbqfBtGyWg8d3XRbNxEhDywI5JBjqj5V/vUKGt6CcJdpyHnmJb2tXRtVi73YyoGsa2U8kG zv6GpCWFeolQ7ymSWIWzL+ofVgtG1Ig3jNlt5GiOUcJhlNVU8Vjp/V+liZo8XCA/kbyOLSD8KXb vmYdyJc6ABiQjJ1QNFkhOsb9g4+MCwUUIyKOen6oeox2sz/OI1qk6OfGZPBRwgt/BRhtmTdDLs0 KDPGwO+pUKE8XgWTcPFAji3p0lCpJUYanTGxtsIPOo1iAz9+iHSkt0dgkEYfpqRZHe51wDqQkYr mlmMyBttkWJzWdaPBPuU12DAEJGyeh9T9kshoRnfp X-Received: by 2002:a05:620a:31a1:b0:8c0:d16b:b0a7 with SMTP id af79cd13be357-8c6a66c8510mr1419194285a.2.1768819233620; Mon, 19 Jan 2026 02:40:33 -0800 (PST) X-Received: by 2002:a05:620a:31a1:b0:8c0:d16b:b0a7 with SMTP id af79cd13be357-8c6a66c8510mr1419192085a.2.1768819233098; Mon, 19 Jan 2026 02:40:33 -0800 (PST) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:4f55:d102:7129:1a8f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4801e8c9cbcsm185185245e9.12.2026.01.19.02.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jan 2026 02:40:32 -0800 (PST) From: Bartosz Golaszewski Date: Mon, 19 Jan 2026 11:40:12 +0100 Subject: [PATCH 1/8] of: provide of_machine_get_compatible() 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: <20260119-soc-of-root-v1-1-32a0fa9a78b4@oss.qualcomm.com> References: <20260119-soc-of-root-v1-0-32a0fa9a78b4@oss.qualcomm.com> In-Reply-To: <20260119-soc-of-root-v1-0-32a0fa9a78b4@oss.qualcomm.com> To: Rob Herring , Saravana Kannan , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , "Christophe Leroy (CS GROUP)" , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Geert Uytterhoeven , Magnus Damm , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1899; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=PbFFIprfToa4la34wmCmAKivaJm7MBQFtk1XHPgSNcg=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpbgoV9sfuT2VvhKGZTGz6p/Fpn/MdjF0ME6wrx zPiggHM5viJAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCaW4KFQAKCRAFnS7L/zaE w7fqD/9JerKCgcU3vWvfo1Hz4H9oZ1Phw/+RcPbdyt6LAUfl+9qyGpxqNKxeCeC13AqyqLCFTU9 vtgZoPGxKFtxYTTB303D8vGvNtcm15aQQnQZ5qQsCTwshMpaxqWTaW0MIBH7rF4bFIuU/hu2k3H km9rXyr2ze7sMGjL2ZdAZbWdq7h4a7rKUOUhB42EBoY/g5t+2Nf0cGItt36Y9VKxVsUrEW1gcTb 2q74U3LKt5IiGzLIdSosJxMYiLQL/5RPBdgkpB4CgpAhTeeCsJ6MzEz6o+3+svQCIxmIf37+OP4 eItXkBJF/sBodLXDhni8ooEdyhdEmn2TXQaSKwq8udjKlU02e4DJa6veW6Lh3rgLkksL1E/D1au Eb8kDWbD13muh/brJ7zVB8uJD25VlpKrIAFoth/coR3lWabcgaICEXy1M+mPho6+NFfieRKNSkm QDLzesgb9UYAXcIDXJ3CaqzVZwimwNqDf/lHjrY9oBr68CdUz9p9Tgeb4O5GWheVuJ1mWY69iIp sdeRdFuVq+TjtnzDhJpHq+lFX5Zyi7nQwcJV3R/Ee0FmJA0BIn5iFt5DzBRvHmXjUMG3DJTVlbl zPo4PHcd/kCpPn5NV81nI1LKkb0ewtXTDhTXxVyOwZQe6VDeANWOXTxYLGU09Vcap5BSadE2NZv UBogRnzIuUXIxSA== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTE5MDA4OCBTYWx0ZWRfX8oe5W6vj3LOR tzEl0MSlySx5mBEr8TTmETdeLyiWmOoVbS+sAZQHkXuXxIt4INwhAhetFGGNUP09r9Mrh9Q/C9h gHmY0sMcKIjfvNa27o3oi6h8+8rLLo0BKstV969AA0znbBfx4wxcy078d/KSJ+2N3jIsm1csywJ 5tHgu8RwS9os6kLWDsPufSzmsXv6anJt1PXJMcmABGVRKJtKCIhQ3kxAmnBFC41ENfme1sq6YEt smBSgSewG+txL+7jKbDuqP55JzEuQDkIP9RdDolleG39YeCp/r0A2C8P3irCjhZgJl5jgLcf71m WJDFMKFOFjT9deDO0+8fZgCrQ93Oo/L09Al29ES+5goV72GggNEJ7lWFXxTuh+OBZW0sh9S8Zpa niYFE0Xze5O+uMEmvK64XotVxvc58VK5zYjoleGti9lLAmhmNFQkedYo1uS1sxOnsKDhjBUvAUN MBvT7e8hthuXl/RCu+g== X-Authority-Analysis: v=2.4 cv=NY3rFmD4 c=1 sm=1 tr=0 ts=696e0a22 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=PolkbJsynZ_iw5VFs6kA:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: m7ydpLRmXAaWBXpXahj3egfq9ZfJBQE6 X-Proofpoint-GUID: m7ydpLRmXAaWBXpXahj3egfq9ZfJBQE6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-19_02,2026-01-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 bulkscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601190088 Provide a helper function allowing users to read the compatible string of the machine, hiding the access to the root node. Signed-off-by: Bartosz Golaszewski Reviewed-by: Christophe Leroy (CS GROUP) --- drivers/of/base.c | 13 +++++++++++++ include/linux/of.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/of/base.c b/drivers/of/base.c index 0b65039ece53aa90f30da2420a893a02ab4c6dd8..a7e27d5355929abd6d156b80c52= f8f8b08fe6da1 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -434,6 +434,19 @@ bool of_machine_compatible_match(const char *const *co= mpats) } EXPORT_SYMBOL(of_machine_compatible_match); =20 +/** + * of_machine_get_compatible - Get the compatible string of this machine + * @compatible: address at which the compatible string will be stored + * + * Returns: + * 0 on success, negative error number on failure. + */ +int of_machine_get_compatible(const char **compatible) +{ + return of_property_read_string(of_root, "compatible", compatible); +} +EXPORT_SYMBOL_GPL(of_machine_get_compatible); + /** * of_machine_device_match - Test root of device tree against a of_device_= id array * @matches: NULL terminated array of of_device_id match structures to sea= rch in diff --git a/include/linux/of.h b/include/linux/of.h index 9bbdcf25a2b448ba4ec5ddee8b35a105ca4aab8b..75423fb556ee4c108ce25144a0b= dc252a89f7d1d 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -426,6 +426,8 @@ static inline bool of_machine_is_compatible(const char = *compat) return of_machine_compatible_match(compats); } =20 +int of_machine_get_compatible(const char **compatible); + extern int of_add_property(struct device_node *np, struct property *prop); extern int of_remove_property(struct device_node *np, struct property *pro= p); extern int of_update_property(struct device_node *np, struct property *new= prop); --=20 2.47.3