Thread (36 messages) 36 messages, 12 authors, 2025-11-11

Re: [PATCH 13/13] soc: tegra: Simplify with of_machine_device_match()

From: Jon Hunter <jonathanh@nvidia.com>
Date: 2025-11-07 10:42:44
Also in: linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-pm, linux-sunxi, linux-tegra, lkml, platform-driver-x86

On 06/11/2025 19:07, Krzysztof Kozlowski wrote:
quoted hunk ↗ jump to hunk
Replace open-coded getting root OF node and matching against it with
new of_machine_device_match() helper.

Signed-off-by: Krzysztof Kozlowski <redacted>

---

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)
Looks good to me ...

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

Thanks
Jon

-- 
nvpublic
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help