Skip to content

Commit 0d2e778

Browse files
hkallweitdavem330
authored andcommitted
net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt
Flag PHY_HAS_INTERRUPT is used only here for this small check. I think using interrupts isn't possible if a driver defines neither config_intr nor ack_interrupts callback. So we can replace checking flag PHY_HAS_INTERRUPT with checking for these callbacks. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e15e067 commit 0d2e778

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/net/phy/phy_device.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,11 @@ static void of_set_phy_eee_broken(struct phy_device *phydev)
20742074
phydev->eee_broken_modes = broken;
20752075
}
20762076

2077+
static bool phy_drv_supports_irq(struct phy_driver *phydrv)
2078+
{
2079+
return phydrv->config_intr || phydrv->ack_interrupt;
2080+
}
2081+
20772082
/**
20782083
* phy_probe - probe and init a PHY device
20792084
* @dev: device to probe and init
@@ -2095,8 +2100,7 @@ static int phy_probe(struct device *dev)
20952100
/* Disable the interrupt if the PHY doesn't support it
20962101
* but the interrupt is still a valid one
20972102
*/
2098-
if (!(phydrv->flags & PHY_HAS_INTERRUPT) &&
2099-
phy_interrupt_is_valid(phydev))
2103+
if (!phy_drv_supports_irq(phydrv) && phy_interrupt_is_valid(phydev))
21002104
phydev->irq = PHY_POLL;
21012105

21022106
if (phydrv->flags & PHY_IS_INTERNAL)

0 commit comments

Comments
 (0)