From: Krzysztof Kozlowski Date: Wed, 12 Nov 2025 10:28:56 +0000 (+0100) Subject: soc: tegra: Simplify with of_machine_device_match() X-Git-Tag: v6.19-rc1~138^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d08989276a4ba82478613787e96791b234e953ba;p=thirdparty%2Flinux.git soc: tegra: Simplify with of_machine_device_match() Replace open-coded getting root OF node and matching against it with new of_machine_device_match() helper. Reviewed-by: Jon Hunter Signed-off-by: Krzysztof Kozlowski Acked-by: Thierry Reding Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20251112-b4-of-match-matchine-data-v2-11-d46b72003fd6@linaro.org Signed-off-by: Rob Herring (Arm) --- diff --git a/drivers/soc/tegra/common.c b/drivers/soc/tegra/common.c index dff6d5ef4e46b..d82b7670abb70 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)