[PATCH 1/4] of_graph: add of_graph_get_endpoint_count()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

same as of_get_child_count()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 include/linux/of_graph.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index f8bcd0e..4b9c3c5 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -91,4 +91,15 @@ static inline struct device_node *of_graph_get_remote_port(
 
 #endif /* CONFIG_OF */
 
+static inline int of_graph_get_endpoint_count(const struct device_node *np)
+{
+	struct device_node *child;
+	int num = 0;
+
+	for_each_endpoint_of_node(np, child)
+		num++;
+
+	return num;
+}
+
 #endif /* __LINUX_OF_GRAPH_H */
-- 
1.9.1




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux