Skip to content

Commit d089892

Browse files
krzkrobherring
authored andcommitted
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 <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>
1 parent 57f77cb commit d089892

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

drivers/soc/tegra/common.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,7 @@ static const struct of_device_id tegra_machine_match[] = {
2727

2828
bool soc_is_tegra(void)
2929
{
30-
const struct of_device_id *match;
31-
struct device_node *root;
32-
33-
root = of_find_node_by_path("/");
34-
if (!root)
35-
return false;
36-
37-
match = of_match_node(tegra_machine_match, root);
38-
of_node_put(root);
39-
40-
return match != NULL;
30+
return of_machine_device_match(tegra_machine_match);
4131
}
4232

4333
static int tegra_core_dev_init_opp_state(struct device *dev)

0 commit comments

Comments
 (0)