]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: tegra: Simplify with of_machine_device_match()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 12 Nov 2025 10:28:56 +0000 (11:28 +0100)
committerRob Herring (Arm) <robh@kernel.org>
Thu, 27 Nov 2025 01:43:12 +0000 (19:43 -0600)
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>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20251112-b4-of-match-matchine-data-v2-11-d46b72003fd6@linaro.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/soc/tegra/common.c

index dff6d5ef4e46bc97c3a7de6457b08871bb75d730..d82b7670abb70cca53fdb4923e3b2fcfd5747cdc 100644 (file)
@@ -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)