Commit 94c043e5 authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by David S. Miller

amd-xgbe: Add check to be sure amd-xgbe-phy driver is used

The amd-xgbe driver relies on the amd-xgbe-phy phylib driver. Add a
check to be sure that if any errors occur during probing of the
amd-xgbe-phy driver then the amd-xgbe driver returns an error.
Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb69cb07
...@@ -260,10 +260,14 @@ int xgbe_mdio_register(struct xgbe_prv_data *pdata) ...@@ -260,10 +260,14 @@ int xgbe_mdio_register(struct xgbe_prv_data *pdata)
of_node_put(phy_node); of_node_put(phy_node);
goto err_phy_device; goto err_phy_device;
} }
if (!phydev->dev.driver) {
dev_err(pdata->dev, "phy driver probe failed\n");
ret = -EIO;
goto err_phy_device;
}
/* Add a reference to the PHY driver so it can't be unloaded */ /* Add a reference to the PHY driver so it can't be unloaded */
pdata->phy_module = phydev->dev.driver ? pdata->phy_module = phydev->dev.driver->owner;
phydev->dev.driver->owner : NULL;
if (!try_module_get(pdata->phy_module)) { if (!try_module_get(pdata->phy_module)) {
dev_err(pdata->dev, "try_module_get failed\n"); dev_err(pdata->dev, "try_module_get failed\n");
ret = -EIO; ret = -EIO;
......
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