aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 9e11039dd7a3..8e4bc8ab692d 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -508,6 +508,18 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
508 return mdiobus_write(phydev->bus, phydev->addr, regnum, val); 508 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
509} 509}
510 510
511/**
512 * phy_interrupt_is_valid - Convenience function for testing a given PHY irq
513 * @phydev: the phy_device struct
514 *
515 * NOTE: must be kept in sync with addition/removal of PHY_POLL and
516 * PHY_IGNORE_INTERRUPT
517 */
518static inline bool phy_interrupt_is_valid(struct phy_device *phydev)
519{
520 return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT;
521}
522
511struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, 523struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
512 bool is_c45, struct phy_c45_device_ids *c45_ids); 524 bool is_c45, struct phy_c45_device_ids *c45_ids);
513struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); 525struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);