aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2019-01-23 22:41:31 +0530
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2019-01-23 22:41:31 +0530
commit60bff2c1db928b5f704493574055c0f060dc4191 (patch)
tree8180886fc2ec4cc6e1781a450b57427b891e6a9b
parent01b48382f7a8c814d2bcc887c1b8db47795e42f4 (diff)
download96b-common-60bff2c1db928b5f704493574055c0f060dc4191.tar.gz
[PATCH net-next] net: phy: fix issue with loading PHY driver w/o initramfsalpha
It was reported that on a system with nfsboot and w/o initramfs network fails because trying to load the PHY driver returns -ENOENT. Reason was that due to missing initramfs the modprobe binary isn't available. So we have to ignore error code -ENOENT. Fixes: 13d0ab6750b2 ("net: phy: check return code when requesting PHY driver module") Reported-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx> Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
-rw-r--r--drivers/net/phy/phy_device.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 5a8e6d53fba5..be3e02166187 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -564,10 +564,12 @@ static int phy_request_driver_module(struct phy_device *dev, int phy_id)
ret = request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT,
MDIO_ID_ARGS(phy_id));
- /* we only check for failures in executing the usermode binary,
- * not whether a PHY driver module exists for the PHY ID
+ /* We only check for failures in executing the usermode binary,
+ * not whether a PHY driver module exists for the PHY ID.
+ * Accept -ENOENT because this may occur in case no initramfs exists,
+ * then modprobe isn't available.
*/
- if (IS_ENABLED(CONFIG_MODULES) && ret < 0) {
+ if (IS_ENABLED(CONFIG_MODULES) && ret < 0 && ret != -ENOENT) {
phydev_err(dev, "error %d loading PHY driver module for ID 0x%08x\n",
ret, phy_id);
return ret;