diff options
author | Andreas Schmidt <mail@schmidt-andreas.de> | 2018-02-22 23:16:27 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-03-05 08:53:49 +0100 |
commit | 9ef2c08930f545f3c0fa2fdc317742c5784e5f4a (patch) | |
tree | 3663936427185ece8f5de2f5d3b905661d867182 /drivers | |
parent | a75136322b02eff2d99b59982fc69b5da7775363 (diff) | |
download | barebox-9ef2c08930f545f3c0fa2fdc317742c5784e5f4a.tar.gz barebox-9ef2c08930f545f3c0fa2fdc317742c5784e5f4a.tar.xz |
net: cpsw: fix probe with fixed-link
While cpsw is probe dt, it accepts only slaves nodes with "phy_id" property.
In case of fixed-link there are no "phy_id" property and probe would be failed.
This patch avoid the failure due to missing "phy_id" in case of fixed-link.
Signed-off-by: Andreas Schmidt <mail@schmidt-andreas.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/cpsw.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index 928b97774b..3d3939cfae 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -1089,11 +1089,13 @@ static int cpsw_probe_dt(struct cpsw_priv *priv) if (i < priv->num_slaves && !strncmp(child->name, "slave", 5)) { struct cpsw_slave *slave = &priv->slaves[i]; - uint32_t phy_id[2]; + uint32_t phy_id[2] = {-1, -1}; - ret = of_property_read_u32_array(child, "phy_id", phy_id, 2); - if (ret) - return ret; + if (!of_find_node_by_name(child, "fixed-link")) { + ret = of_property_read_u32_array(child, "phy_id", phy_id, 2); + if (ret) + return ret; + } slave->dev.device_node = child; slave->phy_id = phy_id[1]; |