Commit 1873c58d authored by Pascal Speck (Iktek)'s avatar Pascal Speck (Iktek) Committed by David S. Miller

ethernet:ti:cpsw: fix phy identification with multiple slaves on fixed-phy

When using more than one slave with ti cpsw and fixed phy the pd->phy_id
will be always zero, but slave_data->phy_id must be unique. pd->phy_id
means a "phy hardware id" whereas slave_data->phy_id means an "unique id",
so we should use pd->addr which has the same unique meaning.

Fixes: 1f71e8c9 ("drivers: net: cpsw: Add support for fixed-link PHY")
Signed-off-by: default avatarPascal Speck <kernel@iktek.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73796d8b
...@@ -2047,7 +2047,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv, ...@@ -2047,7 +2047,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv,
if (!pd) if (!pd)
return -ENODEV; return -ENODEV;
snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
PHY_ID_FMT, pd->bus->id, pd->phy_id); PHY_ID_FMT, pd->bus->id, pd->addr);
goto no_phy_slave; goto no_phy_slave;
} }
parp = of_get_property(slave_node, "phy_id", &lenp); parp = of_get_property(slave_node, "phy_id", &lenp);
......
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