Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 89e1017

Browse files
Uwe Kleine-Königdavem330
authored andcommittedFeb 13, 2014
net: cpsw: catch of_get_phy_mode failing and propagate error
It's wrong if the device tree doesn't provide a phy-mode property for the cpsw slaves as it is documented to be required in Documentation/devicetree/bindings/net/cpsw.txt. Anyhow it's nice to catch that problem, still more as it used to work without this property up to commit 388367a (drivers: net: cpsw: use cpsw-phy-sel driver to configure phy mode) which is in v3.13-rc1. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9b2b6a2 commit 89e1017

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎drivers/net/ethernet/ti/cpsw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,11 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
18961896
memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN);
18971897

18981898
slave_data->phy_if = of_get_phy_mode(slave_node);
1899+
if (slave_data->phy_if < 0) {
1900+
pr_err("Missing or malformed slave[%d] phy-mode property\n",
1901+
i);
1902+
return slave_data->phy_if;
1903+
}
18991904

19001905
if (data->dual_emac) {
19011906
if (of_property_read_u32(slave_node, "dual_emac_res_vlan",

0 commit comments

Comments
 (0)
Failed to load comments.