Commit 21e19442 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: fix issue with loading PHY driver w/o initramfs

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: 13d0ab67 ("net: phy: check return code when requesting PHY driver module")
Reported-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Tested-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0da2b183
......@@ -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;
......
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