xgene: Don't fail probe, if there is no clk resource for SGMII interfaces
This change fixes following problem
[ 1.827940] xgene-enet: probe of 1f210030.ethernet failed with error -2
which leads to a missing ethernet interface (reproducable at least on
Gigabyte MP30-AR0 and APM Mustang systems).
The check for a valid clk resource fails, because DT doesn't provide a
clock for sgenet1. But the driver doesn't use this clk, if the ethernet
port is connected via SGMII. Therefore this patch avoids probing for clk
on SGMII interfaces.
Fixes: 9aea7779b7
("drivers: net: xgene: Fix crash on DT systems")
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e4a6a3424b
commit
0db01097ca
|
@ -1785,16 +1785,18 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
|
||||||
|
|
||||||
xgene_enet_gpiod_get(pdata);
|
xgene_enet_gpiod_get(pdata);
|
||||||
|
|
||||||
pdata->clk = devm_clk_get(&pdev->dev, NULL);
|
if (pdata->phy_mode != PHY_INTERFACE_MODE_SGMII) {
|
||||||
if (IS_ERR(pdata->clk)) {
|
pdata->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
/* Abort if the clock is defined but couldn't be retrived.
|
if (IS_ERR(pdata->clk)) {
|
||||||
* Always abort if the clock is missing on DT system as
|
/* Abort if the clock is defined but couldn't be
|
||||||
* the driver can't cope with this case.
|
* retrived. Always abort if the clock is missing on
|
||||||
*/
|
* DT system as the driver can't cope with this case.
|
||||||
if (PTR_ERR(pdata->clk) != -ENOENT || dev->of_node)
|
*/
|
||||||
return PTR_ERR(pdata->clk);
|
if (PTR_ERR(pdata->clk) != -ENOENT || dev->of_node)
|
||||||
/* Firmware may have set up the clock already. */
|
return PTR_ERR(pdata->clk);
|
||||||
dev_info(dev, "clocks have been setup already\n");
|
/* Firmware may have set up the clock already. */
|
||||||
|
dev_info(dev, "clocks have been setup already\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pdata->phy_mode != PHY_INTERFACE_MODE_XGMII)
|
if (pdata->phy_mode != PHY_INTERFACE_MODE_XGMII)
|
||||||
|
|
Loading…
Reference in New Issue