Use the of_machine_get_match() helper instead of open-coding the same
operation.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/of/base.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 3f061f10aff8fca9..39e751df9daf689f 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -504,15 +504,8 @@ EXPORT_SYMBOL(of_machine_get_match);
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);
+ match = of_machine_get_match(matches);
if (!match)
return NULL;
--
2.43.0