diff options
Diffstat (limited to 'drivers/net/usb/lan78xx.c')
| -rw-r--r-- | drivers/net/usb/lan78xx.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 5655941f1478..3b92ec5916ad 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -1712,13 +1712,16 @@ static int lan78xx_ethtool_set_eeprom(struct net_device *netdev, /* Invalid EEPROM_INDICATOR at offset zero will result in a failure * to load data from EEPROM */ - if (ee->magic == LAN78XX_EEPROM_MAGIC) + if (ee->magic == LAN78XX_EEPROM_MAGIC) { ret = lan78xx_write_raw_eeprom(dev, ee->offset, ee->len, data); - else if ((ee->magic == LAN78XX_OTP_MAGIC) && + } else if ((ee->magic == LAN78XX_OTP_MAGIC) && (ee->offset == 0) && (ee->len == 512) && - (data[0] == OTP_INDICATOR_1)) + (data[0] == OTP_INDICATOR_1)) { ret = lan78xx_write_raw_otp(dev, ee->offset, ee->len, data); + } else { + ret = -EINVAL; + } usb_autopm_put_interface(dev->intf); @@ -2897,6 +2900,7 @@ static int lan78xx_phy_init(struct lan78xx_net *dev) phydev->irq = dev->domain_data.phyirq; else phydev->irq = PHY_POLL; + dev->mdiobus->irq[phydev->mdio.addr] = phydev->irq; netdev_dbg(dev->net, "phydev->irq = %d\n", phydev->irq); ret = phylink_connect_phy(dev->phylink, phydev); |
