Merge tag 'char-misc-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux-2.6-block.git] / drivers / of / property.c
index 606656fb3def7bd578a81a583c05a92b80b3b50a..f61de622f870b70d4bf1525a813245b5a16f7c98 100644 (file)
@@ -665,7 +665,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
                of_node_put(node);
 
                if (!port) {
-                       pr_err("graph: no port node found in %pOF\n", parent);
+                       pr_debug("graph: no port node found in %pOF\n", parent);
                        return NULL;
                }
        } else {
@@ -814,10 +814,16 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
 }
 EXPORT_SYMBOL(of_graph_get_remote_port);
 
-int of_graph_get_endpoint_count(const struct device_node *np)
+/**
+ * of_graph_get_endpoint_count() - get the number of endpoints in a device node
+ * @np: parent device node containing ports and endpoints
+ *
+ * Return: count of endpoint of this device node
+ */
+unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 {
        struct device_node *endpoint;
-       int num = 0;
+       unsigned int num = 0;
 
        for_each_endpoint_of_node(np, endpoint)
                num++;
@@ -1305,7 +1311,7 @@ static struct device_node *parse_remote_endpoint(struct device_node *np,
                                                 int index)
 {
        /* Return NULL for index > 0 to signify end of remote-endpoints. */
-       if (!index || strcmp(prop_name, "remote-endpoint"))
+       if (index > 0 || strcmp(prop_name, "remote-endpoint"))
                return NULL;
 
        return of_graph_get_remote_port_parent(np);