aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/base.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 2390ddb22d60..960ae5bf3ddc 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -612,6 +612,7 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
612 const struct of_device_id **match) 612 const struct of_device_id **match)
613{ 613{
614 struct device_node *np; 614 struct device_node *np;
615 const struct of_device_id *m;
615 616
616 if (match) 617 if (match)
617 *match = NULL; 618 *match = NULL;
@@ -619,9 +620,10 @@ struct device_node *of_find_matching_node_and_match(struct device_node *from,
619 read_lock(&devtree_lock); 620 read_lock(&devtree_lock);
620 np = from ? from->allnext : of_allnodes; 621 np = from ? from->allnext : of_allnodes;
621 for (; np; np = np->allnext) { 622 for (; np; np = np->allnext) {
622 if (of_match_node(matches, np) && of_node_get(np)) { 623 m = of_match_node(matches, np);
624 if (m && of_node_get(np)) {
623 if (match) 625 if (match)
624 *match = matches; 626 *match = m;
625 break; 627 break;
626 } 628 }
627 } 629 }