Commit f468b10e authored by Markus Pargmann's avatar Markus Pargmann Committed by David S. Miller

net: ethernet: cpsw: Search childs for slave nodes

The current implementation searches the whole DT for nodes named
"slave".

This patch changes it to search only child nodes for slaves.
Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
Acked-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
Acked-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d45ed4a4
...@@ -1782,7 +1782,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, ...@@ -1782,7 +1782,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
if (ret) if (ret)
pr_warn("Doesn't have any child node\n"); pr_warn("Doesn't have any child node\n");
for_each_node_by_name(slave_node, "slave") { for_each_child_of_node(node, slave_node) {
struct cpsw_slave_data *slave_data = data->slave_data + i; struct cpsw_slave_data *slave_data = data->slave_data + i;
const void *mac_addr = NULL; const void *mac_addr = NULL;
u32 phyid; u32 phyid;
...@@ -1791,6 +1791,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, ...@@ -1791,6 +1791,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
struct device_node *mdio_node; struct device_node *mdio_node;
struct platform_device *mdio; struct platform_device *mdio;
/* This is no slave child node, continue */
if (strcmp(slave_node->name, "slave"))
continue;
parp = of_get_property(slave_node, "phy_id", &lenp); parp = of_get_property(slave_node, "phy_id", &lenp);
if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) {
pr_err("Missing slave[%d] phy_id property\n", i); pr_err("Missing slave[%d] phy_id property\n", i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment