Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: smsc: skip ENERGYON interrupt if disabled

Don't enable the interrupt if the platform disable the energy detection
by "smsc,disable-energy-detect".

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Marco Felsch and committed by
David S. Miller
73654945 74c654a8

+11 -4
+11 -4
drivers/net/phy/smsc.c
··· 48 48 49 49 static int smsc_phy_config_intr(struct phy_device *phydev) 50 50 { 51 - int rc = phy_write (phydev, MII_LAN83C185_IM, 52 - ((PHY_INTERRUPT_ENABLED == phydev->interrupts) 53 - ? MII_LAN83C185_ISF_INT_PHYLIB_EVENTS 54 - : 0)); 51 + struct smsc_phy_priv *priv = phydev->priv; 52 + u16 intmask = 0; 53 + int rc; 54 + 55 + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { 56 + intmask = MII_LAN83C185_ISF_INT4 | MII_LAN83C185_ISF_INT6; 57 + if (priv->energy_enable) 58 + intmask |= MII_LAN83C185_ISF_INT7; 59 + } 60 + 61 + rc = phy_write(phydev, MII_LAN83C185_IM, intmask); 55 62 56 63 return rc < 0 ? rc : 0; 57 64 }