@@ -612,16 +612,9 @@ struct device_node *of_get_next_child(const struct device_node *node,
612
612
}
613
613
EXPORT_SYMBOL (of_get_next_child );
614
614
615
- /**
616
- * of_get_next_available_child - Find the next available child node
617
- * @node: parent node
618
- * @prev: previous child of the parent node, or NULL to get first
619
- *
620
- * This function is like of_get_next_child(), except that it
621
- * automatically skips any disabled nodes (i.e. status = "disabled").
622
- */
623
- struct device_node * of_get_next_available_child (const struct device_node * node ,
624
- struct device_node * prev )
615
+ static struct device_node * of_get_next_status_child (const struct device_node * node ,
616
+ struct device_node * prev ,
617
+ bool (* checker )(const struct device_node * ))
625
618
{
626
619
struct device_node * next ;
627
620
unsigned long flags ;
@@ -632,7 +625,7 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
632
625
raw_spin_lock_irqsave (& devtree_lock , flags );
633
626
next = prev ? prev -> sibling : node -> child ;
634
627
for (; next ; next = next -> sibling ) {
635
- if (!__of_device_is_available (next ))
628
+ if (!checker (next ))
636
629
continue ;
637
630
if (of_node_get (next ))
638
631
break ;
@@ -641,6 +634,20 @@ struct device_node *of_get_next_available_child(const struct device_node *node,
641
634
raw_spin_unlock_irqrestore (& devtree_lock , flags );
642
635
return next ;
643
636
}
637
+
638
+ /**
639
+ * of_get_next_available_child - Find the next available child node
640
+ * @node: parent node
641
+ * @prev: previous child of the parent node, or NULL to get first
642
+ *
643
+ * This function is like of_get_next_child(), except that it
644
+ * automatically skips any disabled nodes (i.e. status = "disabled").
645
+ */
646
+ struct device_node * of_get_next_available_child (const struct device_node * node ,
647
+ struct device_node * prev )
648
+ {
649
+ return of_get_next_status_child (node , prev , __of_device_is_available );
650
+ }
644
651
EXPORT_SYMBOL (of_get_next_available_child );
645
652
646
653
/**
0 commit comments