diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2013-10-04 08:44:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-07 15:19:31 -0400 |
commit | f468b10e3de6c5f90a14b9c82f1403a2651cef35 (patch) | |
tree | 6c3fa78b4dd2b17f0b7dc6cfe5c9798dc490e18d /drivers/net | |
parent | d45ed4a4e33ae103053c0a53d280014e7101bb5c (diff) |
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: Markus Pargmann <mpa@pengutronix.de>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 79974e31187a..5df50a96a1da 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -1782,7 +1782,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1782 | if (ret) | 1782 | if (ret) |
1783 | pr_warn("Doesn't have any child node\n"); | 1783 | pr_warn("Doesn't have any child node\n"); |
1784 | 1784 | ||
1785 | for_each_node_by_name(slave_node, "slave") { | 1785 | for_each_child_of_node(node, slave_node) { |
1786 | struct cpsw_slave_data *slave_data = data->slave_data + i; | 1786 | struct cpsw_slave_data *slave_data = data->slave_data + i; |
1787 | const void *mac_addr = NULL; | 1787 | const void *mac_addr = NULL; |
1788 | u32 phyid; | 1788 | u32 phyid; |
@@ -1791,6 +1791,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1791 | struct device_node *mdio_node; | 1791 | struct device_node *mdio_node; |
1792 | struct platform_device *mdio; | 1792 | struct platform_device *mdio; |
1793 | 1793 | ||
1794 | /* This is no slave child node, continue */ | ||
1795 | if (strcmp(slave_node->name, "slave")) | ||
1796 | continue; | ||
1797 | |||
1794 | parp = of_get_property(slave_node, "phy_id", &lenp); | 1798 | parp = of_get_property(slave_node, "phy_id", &lenp); |
1795 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { | 1799 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { |
1796 | pr_err("Missing slave[%d] phy_id property\n", i); | 1800 | pr_err("Missing slave[%d] phy_id property\n", i); |