platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables
@ 2025-11-12 10:28 Krzysztof Kozlowski
  2025-11-12 10:28 ` [PATCH v2 01/11] " Krzysztof Kozlowski
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski, Konrad Dybcio, Dmitry Baryshkov

Changes in v2:
- Drop cpufreq/ti change: not correct.
- Drop soc/qcom/qcom_pd_mapper.c - objections from Dmitry and I think
  better to drop the patch in such case.
- I did not implement feedback for first patch to make the
  of_machine_compatible_match() matching machines in arbitrary nodes,
  because there is no such use case possible and no arguments were provided.
  I also did not use cleanup.h in first patch because existing code
  of_device_get_match_data() does not use it and I prefer uniformity.

- Add Ack/Rb tags.
- Link to v1: https://patch.msgid.link/20251106-b4-of-match-matchine-data-v1-0-d780ea1780c2@linaro.org

Dependency/merging
==================
All patches depend on the first patch, thus everything could go via
Rob's tree with people's acks.

Description
===========
Several drivers duplicate same code for getting reference to the root
node, matching it against 'struct of_device_id' table and getting out
the match data from the table entry.

There is a of_machine_compatible_match() wrapper but it takes array of
strings, which is not suitable for many drivers since they want the
driver data associated with each compatible.

Add two wrappers, similar to existing of_device_get_match_data():
1. of_machine_device_match() doing only matching against 'struct
   of_device_id' and returning bool.
2. of_machine_get_match_data() doing the matching and returning
   associated driver data for found compatible.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (11):
      of: Add wrappers to match root node with OF device ID tables
      cpufreq: dt-platdev: Simplify with of_machine_get_match_data()
      cpufreq: mediatek: Simplify with of_machine_get_match_data()
      cpufreq: sun50i: Simplify with of_machine_device_match()
      cpuidle: big_little: Simplify with of_machine_device_match()
      firmware: qcom: scm: Simplify with of_machine_device_match()
      irqchip/atmel-aic: Simplify with of_machine_get_match_data()
      platform: surface: Simplify with of_machine_get_match_data()
      powercap: dtpm: Simplify with of_machine_get_match_data()
      soc: qcom: ubwc: Simplify with of_machine_get_match_data()
      soc: tegra: Simplify with of_machine_device_match()

 drivers/cpufreq/cpufreq-dt-platdev.c               | 15 ++-----
 drivers/cpufreq/mediatek-cpufreq.c                 | 12 +-----
 drivers/cpufreq/sun50i-cpufreq-nvmem.c             | 11 +----
 drivers/cpuidle/cpuidle-big_little.c               | 11 +----
 drivers/firmware/qcom/qcom_scm.c                   | 17 +-------
 drivers/irqchip/irq-atmel-aic-common.c             | 15 ++-----
 drivers/of/base.c                                  | 47 ++++++++++++++++++++++
 .../platform/surface/surface_aggregator_registry.c | 13 +-----
 drivers/powercap/dtpm.c                            | 16 +-------
 drivers/soc/qcom/ubwc_config.c                     | 14 ++-----
 drivers/soc/tegra/common.c                         | 12 +-----
 include/linux/of.h                                 | 13 ++++++
 12 files changed, 79 insertions(+), 117 deletions(-)
---
base-commit: a4ebba34e722123f1c09ce3282e26f052fc8b27f
change-id: 20251106-b4-of-match-matchine-data-4a64bf046814

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 01/11] of: Add wrappers to match root node with OF device ID tables
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-13  9:55   ` Lukasz Luba
  2025-11-12 10:28 ` [PATCH v2 02/11] cpufreq: dt-platdev: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Several drivers duplicate same code for getting reference to the root
node, matching it against 'struct of_device_id' table and getting out
the match data from the table entry.

There is a of_machine_compatible_match() wrapper but it takes array of
strings, which is not suitable for many drivers since they want the
driver data associated with each compatible.

Add two wrappers, similar to existing of_device_get_match_data():
1. of_machine_device_match() doing only matching against 'struct
   of_device_id' and returning bool.
2. of_machine_get_match_data() doing the matching and returning
   associated driver data for found compatible.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

All further patches depend on this.
---
 drivers/of/base.c  | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/of.h | 13 +++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 7043acd971a0..0b65039ece53 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -434,6 +434,53 @@ bool of_machine_compatible_match(const char *const *compats)
 }
 EXPORT_SYMBOL(of_machine_compatible_match);
 
+/**
+ * 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 search in
+ *
+ * Returns true if the root node has any of the given compatible values in its
+ * compatible property.
+ */
+bool of_machine_device_match(const struct of_device_id *matches)
+{
+	struct device_node *root;
+	const struct of_device_id *match = NULL;
+
+	root = of_find_node_by_path("/");
+	if (root) {
+		match = of_match_node(matches, root);
+		of_node_put(root);
+	}
+
+	return match != NULL;
+}
+EXPORT_SYMBOL(of_machine_device_match);
+
+/**
+ * of_machine_get_match_data - Tell if root of device tree has a matching of_match structure
+ * @matches:	NULL terminated array of of_device_id match structures to search in
+ *
+ * Returns data associated with matched entry or NULL
+ */
+const void *of_machine_get_match_data(const struct of_device_id *matches)
+{
+	const struct of_device_id *match;
+	struct device_node *root;
+
+	root = of_find_node_by_path("/");
+	if (!root)
+		return NULL;
+
+	match = of_match_node(matches, root);
+	of_node_put(root);
+
+	if (!match)
+		return NULL;
+
+	return match->data;
+}
+EXPORT_SYMBOL(of_machine_get_match_data);
+
 static bool __of_device_is_status(const struct device_node *device,
 				  const char * const*strings)
 {
diff --git a/include/linux/of.h b/include/linux/of.h
index 121a288ca92d..01bb3affcd49 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -407,6 +407,8 @@ extern int of_alias_get_id(const struct device_node *np, const char *stem);
 extern int of_alias_get_highest_id(const char *stem);
 
 bool of_machine_compatible_match(const char *const *compats);
+bool of_machine_device_match(const struct of_device_id *matches);
+const void *of_machine_get_match_data(const struct of_device_id *matches);
 
 /**
  * of_machine_is_compatible - Test root of device tree for a given compatible value
@@ -855,6 +857,17 @@ static inline bool of_machine_compatible_match(const char *const *compats)
 	return false;
 }
 
+static inline bool of_machine_device_match(const struct of_device_id *matches)
+{
+	return false;
+}
+
+static inline const void *
+of_machine_get_match_data(const struct of_device_id *matches)
+{
+	return NULL;
+}
+
 static inline bool of_console_check(const struct device_node *dn, const char *name, int index)
 {
 	return false;

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 02/11] cpufreq: dt-platdev: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
  2025-11-12 10:28 ` [PATCH v2 01/11] " Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 11:44   ` AngeloGioacchino Del Regno
  2025-11-12 10:28 ` [PATCH v2 03/11] cpufreq: mediatek: " Krzysztof Kozlowski
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node, matching against it and getting
the match data with two new helpers: of_machine_get_match_data() and
of_machine_device_match().

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/cpufreq/cpufreq-dt-platdev.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index dc11b62399ad..a1d11ecd1ac8 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -219,20 +219,13 @@ static bool __init cpu0_node_has_opp_v2_prop(void)
 
 static int __init cpufreq_dt_platdev_init(void)
 {
-	struct device_node *np __free(device_node) = of_find_node_by_path("/");
-	const struct of_device_id *match;
-	const void *data = NULL;
+	const void *data;
 
-	if (!np)
-		return -ENODEV;
-
-	match = of_match_node(allowlist, np);
-	if (match) {
-		data = match->data;
+	data = of_machine_get_match_data(allowlist);
+	if (data)
 		goto create_pdev;
-	}
 
-	if (cpu0_node_has_opp_v2_prop() && !of_match_node(blocklist, np))
+	if (cpu0_node_has_opp_v2_prop() && !of_machine_device_match(blocklist))
 		goto create_pdev;
 
 	return -ENODEV;

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 03/11] cpufreq: mediatek: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
  2025-11-12 10:28 ` [PATCH v2 01/11] " Krzysztof Kozlowski
  2025-11-12 10:28 ` [PATCH v2 02/11] cpufreq: dt-platdev: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 11:44   ` AngeloGioacchino Del Regno
  2025-11-12 10:28 ` [PATCH v2 04/11] cpufreq: sun50i: Simplify with of_machine_device_match() Krzysztof Kozlowski
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node, matching against it and getting
the match data with new of_machine_get_match_data() helper.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/cpufreq/mediatek-cpufreq.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
index 5d50a231f944..052ca7cd2f4f 100644
--- a/drivers/cpufreq/mediatek-cpufreq.c
+++ b/drivers/cpufreq/mediatek-cpufreq.c
@@ -764,22 +764,14 @@ MODULE_DEVICE_TABLE(of, mtk_cpufreq_machines);
 
 static int __init mtk_cpufreq_driver_init(void)
 {
-	struct device_node *np;
-	const struct of_device_id *match;
 	const struct mtk_cpufreq_platform_data *data;
 	int err;
 
-	np = of_find_node_by_path("/");
-	if (!np)
-		return -ENODEV;
-
-	match = of_match_node(mtk_cpufreq_machines, np);
-	of_node_put(np);
-	if (!match) {
+	data = of_machine_get_match_data(mtk_cpufreq_machines);
+	if (!data) {
 		pr_debug("Machine is not compatible with mtk-cpufreq\n");
 		return -ENODEV;
 	}
-	data = match->data;
 
 	err = platform_driver_register(&mtk_cpufreq_platdrv);
 	if (err)

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 04/11] cpufreq: sun50i: Simplify with of_machine_device_match()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 03/11] cpufreq: mediatek: " Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 10:28 ` [PATCH v2 05/11] cpuidle: big_little: " Krzysztof Kozlowski
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node and matching against it with
new of_machine_device_match() helper.

Acked-by: Chen-Yu Tsai <wens@kernel.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/cpufreq/sun50i-cpufreq-nvmem.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
index 744312a44279..4fffc8e83692 100644
--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c
+++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
@@ -332,13 +332,6 @@ static const struct of_device_id sun50i_cpufreq_match_list[] = {
 };
 MODULE_DEVICE_TABLE(of, sun50i_cpufreq_match_list);
 
-static const struct of_device_id *sun50i_cpufreq_match_node(void)
-{
-	struct device_node *np __free(device_node) = of_find_node_by_path("/");
-
-	return of_match_node(sun50i_cpufreq_match_list, np);
-}
-
 /*
  * Since the driver depends on nvmem drivers, which may return EPROBE_DEFER,
  * all the real activity is done in the probe, which may be defered as well.
@@ -346,11 +339,9 @@ static const struct of_device_id *sun50i_cpufreq_match_node(void)
  */
 static int __init sun50i_cpufreq_init(void)
 {
-	const struct of_device_id *match;
 	int ret;
 
-	match = sun50i_cpufreq_match_node();
-	if (!match)
+	if (!of_machine_device_match(sun50i_cpufreq_match_list))
 		return -ENODEV;
 
 	ret = platform_driver_register(&sun50i_cpufreq_driver);

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 05/11] cpuidle: big_little: Simplify with of_machine_device_match()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 04/11] cpufreq: sun50i: Simplify with of_machine_device_match() Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 11:44   ` AngeloGioacchino Del Regno
  2025-11-12 10:28 ` [PATCH v2 06/11] firmware: qcom: scm: " Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node and matching against it with
new of_machine_device_match() helper.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Depends on the first OF patch.
---
 drivers/cpuidle/cpuidle-big_little.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-big_little.c b/drivers/cpuidle/cpuidle-big_little.c
index 4abba42fcc31..08f6bf2f6409 100644
--- a/drivers/cpuidle/cpuidle-big_little.c
+++ b/drivers/cpuidle/cpuidle-big_little.c
@@ -166,20 +166,11 @@ static const struct of_device_id compatible_machine_match[] = {
 static int __init bl_idle_init(void)
 {
 	int ret;
-	struct device_node *root = of_find_node_by_path("/");
-	const struct of_device_id *match_id;
-
-	if (!root)
-		return -ENODEV;
 
 	/*
 	 * Initialize the driver just for a compliant set of machines
 	 */
-	match_id = of_match_node(compatible_machine_match, root);
-
-	of_node_put(root);
-
-	if (!match_id)
+	if (!of_machine_device_match(compatible_machine_match))
 		return -ENODEV;
 
 	if (!mcpm_is_available())

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 06/11] firmware: qcom: scm: Simplify with of_machine_device_match()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 05/11] cpuidle: big_little: " Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 11:44   ` AngeloGioacchino Del Regno
  2025-11-12 10:28 ` [PATCH v2 07/11] irqchip/atmel-aic: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Konrad Dybcio, Krzysztof Kozlowski

Replace open-coded getting root OF node and matching against it with
new of_machine_device_match() helper.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/firmware/qcom/qcom_scm.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index e777b7cb9b12..1a6f85e463e0 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -2018,21 +2018,6 @@ static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
 	{ }
 };
 
-static bool qcom_scm_qseecom_machine_is_allowed(void)
-{
-	struct device_node *np;
-	bool match;
-
-	np = of_find_node_by_path("/");
-	if (!np)
-		return false;
-
-	match = of_match_node(qcom_scm_qseecom_allowlist, np);
-	of_node_put(np);
-
-	return match;
-}
-
 static void qcom_scm_qseecom_free(void *data)
 {
 	struct platform_device *qseecom_dev = data;
@@ -2064,7 +2049,7 @@ static int qcom_scm_qseecom_init(struct qcom_scm *scm)
 
 	dev_info(scm->dev, "qseecom: found qseecom with version 0x%x\n", version);
 
-	if (!qcom_scm_qseecom_machine_is_allowed()) {
+	if (!of_machine_device_match(qcom_scm_qseecom_allowlist)) {
 		dev_info(scm->dev, "qseecom: untested machine, skipping\n");
 		return 0;
 	}

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 07/11] irqchip/atmel-aic: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 06/11] firmware: qcom: scm: " Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 13:06   ` Alexandre Belloni
  2025-11-12 10:28 ` [PATCH v2 08/11] platform: surface: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node, matching against it and getting
the match data with new of_machine_get_match_data() helper.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/irqchip/irq-atmel-aic-common.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
index 3cad30a40c19..e68853815c7a 100644
--- a/drivers/irqchip/irq-atmel-aic-common.c
+++ b/drivers/irqchip/irq-atmel-aic-common.c
@@ -187,20 +187,11 @@ void __init aic_common_rtt_irq_fixup(void)
 
 static void __init aic_common_irq_fixup(const struct of_device_id *matches)
 {
-	struct device_node *root = of_find_node_by_path("/");
-	const struct of_device_id *match;
+	void (*fixup)(void);
 
-	if (!root)
-		return;
-
-	match = of_match_node(matches, root);
-
-	if (match) {
-		void (*fixup)(void) = match->data;
+	fixup = of_machine_get_match_data(matches);
+	if (fixup)
 		fixup();
-	}
-
-	of_node_put(root);
 }
 
 struct irq_domain *__init aic_common_of_init(struct device_node *node,

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 08/11] platform: surface: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 07/11] irqchip/atmel-aic: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 10:28 ` [PATCH v2 09/11] powercap: dtpm: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node, matching against it and getting
the match data with new of_machine_get_match_data() helper.

Acked-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/platform/surface/surface_aggregator_registry.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
index a594d5fcfcfd..78ac3a8fbb73 100644
--- a/drivers/platform/surface/surface_aggregator_registry.c
+++ b/drivers/platform/surface/surface_aggregator_registry.c
@@ -491,24 +491,13 @@ static const struct of_device_id ssam_platform_hub_of_match[] __maybe_unused = {
 static int ssam_platform_hub_probe(struct platform_device *pdev)
 {
 	const struct software_node **nodes;
-	const struct of_device_id *match;
-	struct device_node *fdt_root;
 	struct ssam_controller *ctrl;
 	struct fwnode_handle *root;
 	int status;
 
 	nodes = (const struct software_node **)acpi_device_get_match_data(&pdev->dev);
 	if (!nodes) {
-		fdt_root = of_find_node_by_path("/");
-		if (!fdt_root)
-			return -ENODEV;
-
-		match = of_match_node(ssam_platform_hub_of_match, fdt_root);
-		of_node_put(fdt_root);
-		if (!match)
-			return -ENODEV;
-
-		nodes = (const struct software_node **)match->data;
+		nodes = (const struct software_node **)of_machine_get_match_data(ssam_platform_hub_of_match);
 		if (!nodes)
 			return -ENODEV;
 	}

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 09/11] powercap: dtpm: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (7 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 08/11] platform: surface: " Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-13  9:50   ` Lukasz Luba
  2025-11-12 10:28 ` [PATCH v2 10/11] soc: qcom: ubwc: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node, matching against it and getting
the match data with new of_machine_get_match_data() helper.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Depends on the first OF patch.
---
 drivers/powercap/dtpm.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
index f390665743c4..129d55bc705c 100644
--- a/drivers/powercap/dtpm.c
+++ b/drivers/powercap/dtpm.c
@@ -548,9 +548,7 @@ static int dtpm_for_each_child(const struct dtpm_node *hierarchy,
  */
 int dtpm_create_hierarchy(struct of_device_id *dtpm_match_table)
 {
-	const struct of_device_id *match;
 	const struct dtpm_node *hierarchy;
-	struct device_node *np;
 	int i, ret;
 
 	mutex_lock(&dtpm_lock);
@@ -567,19 +565,7 @@ int dtpm_create_hierarchy(struct of_device_id *dtpm_match_table)
 		goto out_pct;
 	}
 
-	ret = -ENODEV;
-	np = of_find_node_by_path("/");
-	if (!np)
-		goto out_err;
-
-	match = of_match_node(dtpm_match_table, np);
-
-	of_node_put(np);
-
-	if (!match)
-		goto out_err;
-
-	hierarchy = match->data;
+	hierarchy = of_machine_get_match_data(dtpm_match_table);
 	if (!hierarchy) {
 		ret = -EFAULT;
 		goto out_err;

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 10/11] soc: qcom: ubwc: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (8 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 09/11] powercap: dtpm: " Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 10:28 ` [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match() Krzysztof Kozlowski
  2025-11-12 11:52 ` [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables AngeloGioacchino Del Regno
  11 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Dmitry Baryshkov, Krzysztof Kozlowski

Replace open-coded getting root OF node, matching against it and getting
the match data with new of_machine_get_match_data() helper.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/soc/qcom/ubwc_config.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
index 1c09796163b0..1c25aaf55e52 100644
--- a/drivers/soc/qcom/ubwc_config.c
+++ b/drivers/soc/qcom/ubwc_config.c
@@ -301,21 +301,15 @@ static const struct of_device_id qcom_ubwc_configs[] __maybe_unused = {
 
 const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void)
 {
-	const struct of_device_id *match;
-	struct device_node *root;
+	const struct qcom_ubwc_cfg_data *data;
 
-	root = of_find_node_by_path("/");
-	if (!root)
-		return ERR_PTR(-ENODEV);
-
-	match = of_match_node(qcom_ubwc_configs, root);
-	of_node_put(root);
-	if (!match) {
+	data = of_machine_get_match_data(qcom_ubwc_configs);
+	if (!data) {
 		pr_err("Couldn't find UBWC config data for this platform!\n");
 		return ERR_PTR(-EINVAL);
 	}
 
-	return match->data;
+	return data;
 }
 EXPORT_SYMBOL_GPL(qcom_ubwc_config_get_data);
 

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match()
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (9 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 10/11] soc: qcom: ubwc: " Krzysztof Kozlowski
@ 2025-11-12 10:28 ` Krzysztof Kozlowski
  2025-11-12 11:44   ` AngeloGioacchino Del Regno
  2025-11-14 13:17   ` Thierry Reding
  2025-11-12 11:52 ` [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables AngeloGioacchino Del Regno
  11 siblings, 2 replies; 23+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-12 10:28 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Krzysztof Kozlowski

Replace open-coded getting root OF node and matching against it with
new of_machine_device_match() helper.

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Depends on the first OF patch.
---
 drivers/soc/tegra/common.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/soc/tegra/common.c b/drivers/soc/tegra/common.c
index dff6d5ef4e46..d82b7670abb7 100644
--- a/drivers/soc/tegra/common.c
+++ b/drivers/soc/tegra/common.c
@@ -27,17 +27,7 @@ static const struct of_device_id tegra_machine_match[] = {
 
 bool soc_is_tegra(void)
 {
-	const struct of_device_id *match;
-	struct device_node *root;
-
-	root = of_find_node_by_path("/");
-	if (!root)
-		return false;
-
-	match = of_match_node(tegra_machine_match, root);
-	of_node_put(root);
-
-	return match != NULL;
+	return of_machine_device_match(tegra_machine_match);
 }
 
 static int tegra_core_dev_init_opp_state(struct device *dev)

-- 
2.48.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match()
  2025-11-12 10:28 ` [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match() Krzysztof Kozlowski
@ 2025-11-12 11:44   ` AngeloGioacchino Del Regno
  2025-11-14 13:17   ` Thierry Reding
  1 sibling, 0 replies; 23+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-11-12 11:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Saravana Kannan,
	Rafael J. Wysocki, Viresh Kumar, Matthias Brugger, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra

Il 12/11/25 11:28, Krzysztof Kozlowski ha scritto:
> Replace open-coded getting root OF node and matching against it with
> new of_machine_device_match() helper.
> 
> Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 05/11] cpuidle: big_little: Simplify with of_machine_device_match()
  2025-11-12 10:28 ` [PATCH v2 05/11] cpuidle: big_little: " Krzysztof Kozlowski
@ 2025-11-12 11:44   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 23+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-11-12 11:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Saravana Kannan,
	Rafael J. Wysocki, Viresh Kumar, Matthias Brugger, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra

Il 12/11/25 11:28, Krzysztof Kozlowski ha scritto:
> Replace open-coded getting root OF node and matching against it with
> new of_machine_device_match() helper.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 03/11] cpufreq: mediatek: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 ` [PATCH v2 03/11] cpufreq: mediatek: " Krzysztof Kozlowski
@ 2025-11-12 11:44   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 23+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-11-12 11:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Saravana Kannan,
	Rafael J. Wysocki, Viresh Kumar, Matthias Brugger, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra

Il 12/11/25 11:28, Krzysztof Kozlowski ha scritto:
> Replace open-coded getting root OF node, matching against it and getting
> the match data with new of_machine_get_match_data() helper.
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>




^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 02/11] cpufreq: dt-platdev: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 ` [PATCH v2 02/11] cpufreq: dt-platdev: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
@ 2025-11-12 11:44   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 23+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-11-12 11:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Saravana Kannan,
	Rafael J. Wysocki, Viresh Kumar, Matthias Brugger, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra

Il 12/11/25 11:28, Krzysztof Kozlowski ha scritto:
> Replace open-coded getting root OF node, matching against it and getting
> the match data with two new helpers: of_machine_get_match_data() and
> of_machine_device_match().
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 06/11] firmware: qcom: scm: Simplify with of_machine_device_match()
  2025-11-12 10:28 ` [PATCH v2 06/11] firmware: qcom: scm: " Krzysztof Kozlowski
@ 2025-11-12 11:44   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 23+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-11-12 11:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Saravana Kannan,
	Rafael J. Wysocki, Viresh Kumar, Matthias Brugger, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Konrad Dybcio

Il 12/11/25 11:28, Krzysztof Kozlowski ha scritto:
> Replace open-coded getting root OF node and matching against it with
> new of_machine_device_match() helper.
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables
  2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
                   ` (10 preceding siblings ...)
  2025-11-12 10:28 ` [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match() Krzysztof Kozlowski
@ 2025-11-12 11:52 ` AngeloGioacchino Del Regno
  2025-11-14 13:24   ` Thierry Reding
  11 siblings, 1 reply; 23+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-11-12 11:52 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Saravana Kannan,
	Rafael J. Wysocki, Viresh Kumar, Matthias Brugger, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter
  Cc: devicetree, linux-kernel, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Konrad Dybcio, Dmitry Baryshkov

Il 12/11/25 11:28, Krzysztof Kozlowski ha scritto:
> Changes in v2:

Note:

Looks ok based on code and based on testing on the following platforms:
  - tegra: Jetson Xavier NX Development Kit
  - qcom: sdm630 Sony Xperia XA2 (Nile), sc7180 Trogdor Lazor Chromebook
  - mediatek: MT6795 Xperia M5 (midstream kernel), MT8173 Elm Chromebook
              MT8365 Genio 350 (mt8365-evk)

Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Cheers,
Angelo

> - Drop cpufreq/ti change: not correct.
> - Drop soc/qcom/qcom_pd_mapper.c - objections from Dmitry and I think
>    better to drop the patch in such case.
> - I did not implement feedback for first patch to make the
>    of_machine_compatible_match() matching machines in arbitrary nodes,
>    because there is no such use case possible and no arguments were provided.
>    I also did not use cleanup.h in first patch because existing code
>    of_device_get_match_data() does not use it and I prefer uniformity.
> 
> - Add Ack/Rb tags.
> - Link to v1: https://patch.msgid.link/20251106-b4-of-match-matchine-data-v1-0-d780ea1780c2@linaro.org
> 
> Dependency/merging
> ==================
> All patches depend on the first patch, thus everything could go via
> Rob's tree with people's acks.
> 
> Description
> ===========
> Several drivers duplicate same code for getting reference to the root
> node, matching it against 'struct of_device_id' table and getting out
> the match data from the table entry.
> 
> There is a of_machine_compatible_match() wrapper but it takes array of
> strings, which is not suitable for many drivers since they want the
> driver data associated with each compatible.
> 
> Add two wrappers, similar to existing of_device_get_match_data():
> 1. of_machine_device_match() doing only matching against 'struct
>     of_device_id' and returning bool.
> 2. of_machine_get_match_data() doing the matching and returning
>     associated driver data for found compatible.
> 
> Best regards,
> Krzysztof
> 
> ---
> Krzysztof Kozlowski (11):
>        of: Add wrappers to match root node with OF device ID tables
>        cpufreq: dt-platdev: Simplify with of_machine_get_match_data()
>        cpufreq: mediatek: Simplify with of_machine_get_match_data()
>        cpufreq: sun50i: Simplify with of_machine_device_match()
>        cpuidle: big_little: Simplify with of_machine_device_match()
>        firmware: qcom: scm: Simplify with of_machine_device_match()
>        irqchip/atmel-aic: Simplify with of_machine_get_match_data()
>        platform: surface: Simplify with of_machine_get_match_data()
>        powercap: dtpm: Simplify with of_machine_get_match_data()
>        soc: qcom: ubwc: Simplify with of_machine_get_match_data()
>        soc: tegra: Simplify with of_machine_device_match()
> 
>   drivers/cpufreq/cpufreq-dt-platdev.c               | 15 ++-----
>   drivers/cpufreq/mediatek-cpufreq.c                 | 12 +-----
>   drivers/cpufreq/sun50i-cpufreq-nvmem.c             | 11 +----
>   drivers/cpuidle/cpuidle-big_little.c               | 11 +----
>   drivers/firmware/qcom/qcom_scm.c                   | 17 +-------
>   drivers/irqchip/irq-atmel-aic-common.c             | 15 ++-----
>   drivers/of/base.c                                  | 47 ++++++++++++++++++++++
>   .../platform/surface/surface_aggregator_registry.c | 13 +-----
>   drivers/powercap/dtpm.c                            | 16 +-------
>   drivers/soc/qcom/ubwc_config.c                     | 14 ++-----
>   drivers/soc/tegra/common.c                         | 12 +-----
>   include/linux/of.h                                 | 13 ++++++
>   12 files changed, 79 insertions(+), 117 deletions(-)
> ---
> base-commit: a4ebba34e722123f1c09ce3282e26f052fc8b27f
> change-id: 20251106-b4-of-match-matchine-data-4a64bf046814
> 
> Best regards,


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 07/11] irqchip/atmel-aic: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 ` [PATCH v2 07/11] irqchip/atmel-aic: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
@ 2025-11-12 13:06   ` Alexandre Belloni
  0 siblings, 0 replies; 23+ messages in thread
From: Alexandre Belloni @ 2025-11-12 13:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Claudiu Beznea, Maximilian Luz, Hans de Goede,
	Ilpo Järvinen, Daniel Lezcano, Thierry Reding,
	Jonathan Hunter, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, linux-mediatek, linux-sunxi, linux-arm-msm,
	platform-driver-x86, linux-tegra

On 12/11/2025 11:28:52+0100, Krzysztof Kozlowski wrote:
> Replace open-coded getting root OF node, matching against it and getting
> the match data with new of_machine_get_match_data() helper.
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> 
> Depends on the first OF patch.
> ---
>  drivers/irqchip/irq-atmel-aic-common.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
> index 3cad30a40c19..e68853815c7a 100644
> --- a/drivers/irqchip/irq-atmel-aic-common.c
> +++ b/drivers/irqchip/irq-atmel-aic-common.c
> @@ -187,20 +187,11 @@ void __init aic_common_rtt_irq_fixup(void)
>  
>  static void __init aic_common_irq_fixup(const struct of_device_id *matches)
>  {
> -	struct device_node *root = of_find_node_by_path("/");
> -	const struct of_device_id *match;
> +	void (*fixup)(void);
>  
> -	if (!root)
> -		return;
> -
> -	match = of_match_node(matches, root);
> -
> -	if (match) {
> -		void (*fixup)(void) = match->data;
> +	fixup = of_machine_get_match_data(matches);
> +	if (fixup)
>  		fixup();
> -	}
> -
> -	of_node_put(root);
>  }
>  
>  struct irq_domain *__init aic_common_of_init(struct device_node *node,
> 
> -- 
> 2.48.1
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 09/11] powercap: dtpm: Simplify with of_machine_get_match_data()
  2025-11-12 10:28 ` [PATCH v2 09/11] powercap: dtpm: " Krzysztof Kozlowski
@ 2025-11-13  9:50   ` Lukasz Luba
  0 siblings, 0 replies; 23+ messages in thread
From: Lukasz Luba @ 2025-11-13  9:50 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: devicetree, linux-kernel, Alexandre Belloni, Samuel Holland,
	Matthias Brugger, Viresh Kumar, Rafael J. Wysocki, Thierry Reding,
	Daniel Lezcano, Claudiu Beznea, Saravana Kannan, Jonathan Hunter,
	Nicolas Ferre, Thomas Gleixner, Maximilian Luz,
	Ilpo Järvinen, Konrad Dybcio, Bjorn Andersson,
	Daniel Lezcano, Lorenzo Pieralisi, linux-pm, Chen-Yu Tsai,
	Yangtao Li, AngeloGioacchino Del Regno, linux-arm-kernel,
	linux-mediatek, linux-sunxi, linux-arm-msm, platform-driver-x86,
	linux-tegra, Rob Herring, Jernej Skrabec, Hans de Goede



On 11/12/25 10:28, Krzysztof Kozlowski wrote:
> Replace open-coded getting root OF node, matching against it and getting
> the match data with new of_machine_get_match_data() helper.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Depends on the first OF patch.
> ---
>   drivers/powercap/dtpm.c | 16 +---------------
>   1 file changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
> index f390665743c4..129d55bc705c 100644
> --- a/drivers/powercap/dtpm.c
> +++ b/drivers/powercap/dtpm.c
> @@ -548,9 +548,7 @@ static int dtpm_for_each_child(const struct dtpm_node *hierarchy,
>    */
>   int dtpm_create_hierarchy(struct of_device_id *dtpm_match_table)
>   {
> -	const struct of_device_id *match;
>   	const struct dtpm_node *hierarchy;
> -	struct device_node *np;
>   	int i, ret;
>   
>   	mutex_lock(&dtpm_lock);
> @@ -567,19 +565,7 @@ int dtpm_create_hierarchy(struct of_device_id *dtpm_match_table)
>   		goto out_pct;
>   	}
>   
> -	ret = -ENODEV;
> -	np = of_find_node_by_path("/");
> -	if (!np)
> -		goto out_err;
> -
> -	match = of_match_node(dtpm_match_table, np);
> -
> -	of_node_put(np);
> -
> -	if (!match)
> -		goto out_err;
> -
> -	hierarchy = match->data;
> +	hierarchy = of_machine_get_match_data(dtpm_match_table);
>   	if (!hierarchy) {
>   		ret = -EFAULT;
>   		goto out_err;
> 

I don't know if Daniel had a chance to look at it, but I can help him.

The patch looks OK.

The extra return error value which is removed doesn't harm the client of
this function in other subsystem.

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 01/11] of: Add wrappers to match root node with OF device ID tables
  2025-11-12 10:28 ` [PATCH v2 01/11] " Krzysztof Kozlowski
@ 2025-11-13  9:55   ` Lukasz Luba
  0 siblings, 0 replies; 23+ messages in thread
From: Lukasz Luba @ 2025-11-13  9:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: devicetree, linux-kernel, Samuel Holland, Matthias Brugger,
	Viresh Kumar, Rafael J. Wysocki, Saravana Kannan, Jonathan Hunter,
	Thierry Reding, Daniel Lezcano, Hans de Goede, Maximilian Luz,
	Thomas Gleixner, Bjorn Andersson, Daniel Lezcano,
	Ilpo Järvinen, Lorenzo Pieralisi, Rob Herring, linux-pm,
	Claudiu Beznea, Alexandre Belloni, Nicolas Ferre, Jernej Skrabec,
	Chen-Yu Tsai, Yangtao Li, AngeloGioacchino Del Regno,
	linux-arm-kernel, linux-mediatek, linux-sunxi, linux-arm-msm,
	platform-driver-x86, linux-tegra, Konrad Dybcio

Hi Krzysztof,

On 11/12/25 10:28, Krzysztof Kozlowski wrote:
> Several drivers duplicate same code for getting reference to the root
> node, matching it against 'struct of_device_id' table and getting out
> the match data from the table entry.
> 
> There is a of_machine_compatible_match() wrapper but it takes array of
> strings, which is not suitable for many drivers since they want the
> driver data associated with each compatible.
> 
> Add two wrappers, similar to existing of_device_get_match_data():
> 1. of_machine_device_match() doing only matching against 'struct
>     of_device_id' and returning bool.
> 2. of_machine_get_match_data() doing the matching and returning
>     associated driver data for found compatible.
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> 
> All further patches depend on this.
> ---
>   drivers/of/base.c  | 47 +++++++++++++++++++++++++++++++++++++++++++++++
>   include/linux/of.h | 13 +++++++++++++
>   2 files changed, 60 insertions(+)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 7043acd971a0..0b65039ece53 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -434,6 +434,53 @@ bool of_machine_compatible_match(const char *const *compats)
>   }
>   EXPORT_SYMBOL(of_machine_compatible_match);
>   
> +/**
> + * 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 search in
> + *
> + * Returns true if the root node has any of the given compatible values in its
> + * compatible property.
> + */
> +bool of_machine_device_match(const struct of_device_id *matches)
> +{
> +	struct device_node *root;
> +	const struct of_device_id *match = NULL;
> +
> +	root = of_find_node_by_path("/");
> +	if (root) {
> +		match = of_match_node(matches, root);
> +		of_node_put(root);
> +	}
> +
> +	return match != NULL;
> +}
> +EXPORT_SYMBOL(of_machine_device_match);
> +
> +/**
> + * of_machine_get_match_data - Tell if root of device tree has a matching of_match structure
> + * @matches:	NULL terminated array of of_device_id match structures to search in
> + *
> + * Returns data associated with matched entry or NULL
> + */
> +const void *of_machine_get_match_data(const struct of_device_id *matches)
> +{
> +	const struct of_device_id *match;
> +	struct device_node *root;
> +
> +	root = of_find_node_by_path("/");
> +	if (!root)
> +		return NULL;
> +
> +	match = of_match_node(matches, root);
> +	of_node_put(root);
> +
> +	if (!match)
> +		return NULL;
> +
> +	return match->data;
> +}
> +EXPORT_SYMBOL(of_machine_get_match_data);
> +
>   static bool __of_device_is_status(const struct device_node *device,
>   				  const char * const*strings)
>   {
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 121a288ca92d..01bb3affcd49 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -407,6 +407,8 @@ extern int of_alias_get_id(const struct device_node *np, const char *stem);
>   extern int of_alias_get_highest_id(const char *stem);
>   
>   bool of_machine_compatible_match(const char *const *compats);
> +bool of_machine_device_match(const struct of_device_id *matches);
> +const void *of_machine_get_match_data(const struct of_device_id *matches);
>   
>   /**
>    * of_machine_is_compatible - Test root of device tree for a given compatible value
> @@ -855,6 +857,17 @@ static inline bool of_machine_compatible_match(const char *const *compats)
>   	return false;
>   }
>   
> +static inline bool of_machine_device_match(const struct of_device_id *matches)
> +{
> +	return false;
> +}
> +
> +static inline const void *
> +of_machine_get_match_data(const struct of_device_id *matches)
> +{
> +	return NULL;
> +}
> +
>   static inline bool of_console_check(const struct device_node *dn, const char *name, int index)
>   {
>   	return false;
> 

Makes sense based on the clean-up in dtpm.c (since I've been there
I looked here as well).

LGTM

Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

Regards,
Lukasz

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match()
  2025-11-12 10:28 ` [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match() Krzysztof Kozlowski
  2025-11-12 11:44   ` AngeloGioacchino Del Regno
@ 2025-11-14 13:17   ` Thierry Reding
  1 sibling, 0 replies; 23+ messages in thread
From: Thierry Reding @ 2025-11-14 13:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Saravana Kannan, Rafael J. Wysocki, Viresh Kumar,
	Matthias Brugger, AngeloGioacchino Del Regno, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano,
	Jonathan Hunter, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, linux-mediatek, linux-sunxi, linux-arm-msm,
	platform-driver-x86, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

On Wed, Nov 12, 2025 at 11:28:56AM +0100, Krzysztof Kozlowski wrote:
> Replace open-coded getting root OF node and matching against it with
> new of_machine_device_match() helper.
> 
> Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> 
> Depends on the first OF patch.
> ---
>  drivers/soc/tegra/common.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)

I assume that you'd want to take this through the DT (or some other)
tree, so:

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables
  2025-11-12 11:52 ` [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables AngeloGioacchino Del Regno
@ 2025-11-14 13:24   ` Thierry Reding
  0 siblings, 0 replies; 23+ messages in thread
From: Thierry Reding @ 2025-11-14 13:24 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Krzysztof Kozlowski, Rob Herring, Saravana Kannan,
	Rafael J. Wysocki, Viresh Kumar, Matthias Brugger, Yangtao Li,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Lorenzo Pieralisi,
	Daniel Lezcano, Bjorn Andersson, Konrad Dybcio, Thomas Gleixner,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maximilian Luz,
	Hans de Goede, Ilpo Järvinen, Daniel Lezcano,
	Jonathan Hunter, devicetree, linux-kernel, linux-pm,
	linux-arm-kernel, linux-mediatek, linux-sunxi, linux-arm-msm,
	platform-driver-x86, linux-tegra, Konrad Dybcio, Dmitry Baryshkov

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

On Wed, Nov 12, 2025 at 12:52:48PM +0100, AngeloGioacchino Del Regno wrote:
> Il 12/11/25 11:28, Krzysztof Kozlowski ha scritto:
> > Changes in v2:
> 
> Note:
> 
> Looks ok based on code and based on testing on the following platforms:
>  - tegra: Jetson Xavier NX Development Kit

Thanks for testing, but Xavier NX doesn't run any of the code changed by
this patch. soc_is_tegra() is a legacy function that we need for DT
backwards-compatibility and should only run on 32-bit ARM devices.

Technically there's one case in drivers/soc/tegra/flowctrl.c that runs
this on Tegra210, but it should probably undergo the same treatment as
the PMC and FUSE drivers. The code that needs this is only used for CPU
power management on 32-bit ARM devices.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-11-14 13:24 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-12 10:28 [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables Krzysztof Kozlowski
2025-11-12 10:28 ` [PATCH v2 01/11] " Krzysztof Kozlowski
2025-11-13  9:55   ` Lukasz Luba
2025-11-12 10:28 ` [PATCH v2 02/11] cpufreq: dt-platdev: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
2025-11-12 11:44   ` AngeloGioacchino Del Regno
2025-11-12 10:28 ` [PATCH v2 03/11] cpufreq: mediatek: " Krzysztof Kozlowski
2025-11-12 11:44   ` AngeloGioacchino Del Regno
2025-11-12 10:28 ` [PATCH v2 04/11] cpufreq: sun50i: Simplify with of_machine_device_match() Krzysztof Kozlowski
2025-11-12 10:28 ` [PATCH v2 05/11] cpuidle: big_little: " Krzysztof Kozlowski
2025-11-12 11:44   ` AngeloGioacchino Del Regno
2025-11-12 10:28 ` [PATCH v2 06/11] firmware: qcom: scm: " Krzysztof Kozlowski
2025-11-12 11:44   ` AngeloGioacchino Del Regno
2025-11-12 10:28 ` [PATCH v2 07/11] irqchip/atmel-aic: Simplify with of_machine_get_match_data() Krzysztof Kozlowski
2025-11-12 13:06   ` Alexandre Belloni
2025-11-12 10:28 ` [PATCH v2 08/11] platform: surface: " Krzysztof Kozlowski
2025-11-12 10:28 ` [PATCH v2 09/11] powercap: dtpm: " Krzysztof Kozlowski
2025-11-13  9:50   ` Lukasz Luba
2025-11-12 10:28 ` [PATCH v2 10/11] soc: qcom: ubwc: " Krzysztof Kozlowski
2025-11-12 10:28 ` [PATCH v2 11/11] soc: tegra: Simplify with of_machine_device_match() Krzysztof Kozlowski
2025-11-12 11:44   ` AngeloGioacchino Del Regno
2025-11-14 13:17   ` Thierry Reding
2025-11-12 11:52 ` [PATCH v2 00/11] of: Add wrappers to match root node with OF device ID tables AngeloGioacchino Del Regno
2025-11-14 13:24   ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).