Commit 23a09873 authored by Johan Hovold's avatar Johan Hovold Committed by David S. Miller

net: ethernet: ti: cpsw: fix fixed-link phy probe deferral

Make sure to propagate errors from of_phy_register_fixed_link() which
can fail with -EPROBE_DEFER.

Fixes: 1f71e8c9 ("drivers: net: cpsw: Add support for fixed-link
PHY")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3420ea88
...@@ -2375,8 +2375,11 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, ...@@ -2375,8 +2375,11 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
* to the PHY is the Ethernet MAC DT node. * to the PHY is the Ethernet MAC DT node.
*/ */
ret = of_phy_register_fixed_link(slave_node); ret = of_phy_register_fixed_link(slave_node);
if (ret) if (ret) {
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "failed to register fixed-link phy: %d\n", ret);
return ret; return ret;
}
slave_data->phy_node = of_node_get(slave_node); slave_data->phy_node = of_node_get(slave_node);
} else if (parp) { } else if (parp) {
u32 phyid; u32 phyid;
...@@ -2637,11 +2640,10 @@ static int cpsw_probe(struct platform_device *pdev) ...@@ -2637,11 +2640,10 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_runtime_disable_ret; goto clean_runtime_disable_ret;
} }
if (cpsw_probe_dt(&cpsw->data, pdev)) { ret = cpsw_probe_dt(&cpsw->data, pdev);
dev_err(&pdev->dev, "cpsw: platform data missing\n"); if (ret)
ret = -ENODEV;
goto clean_dt_ret; goto clean_dt_ret;
}
data = &cpsw->data; data = &cpsw->data;
cpsw->rx_ch_num = 1; cpsw->rx_ch_num = 1;
cpsw->tx_ch_num = 1; cpsw->tx_ch_num = 1;
......
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