diff options
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 20cc82c78137..df4e6257d4a7 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -58,55 +58,6 @@ EXPORT_SYMBOL(phy_print_status); | |||
58 | 58 | ||
59 | 59 | ||
60 | /** | 60 | /** |
61 | * phy_read - Convenience function for reading a given PHY register | ||
62 | * @phydev: the phy_device struct | ||
63 | * @regnum: register number to read | ||
64 | * | ||
65 | * NOTE: MUST NOT be called from interrupt context, | ||
66 | * because the bus read/write functions may wait for an interrupt | ||
67 | * to conclude the operation. | ||
68 | */ | ||
69 | int phy_read(struct phy_device *phydev, u16 regnum) | ||
70 | { | ||
71 | int retval; | ||
72 | struct mii_bus *bus = phydev->bus; | ||
73 | |||
74 | BUG_ON(in_interrupt()); | ||
75 | |||
76 | mutex_lock(&bus->mdio_lock); | ||
77 | retval = bus->read(bus, phydev->addr, regnum); | ||
78 | mutex_unlock(&bus->mdio_lock); | ||
79 | |||
80 | return retval; | ||
81 | } | ||
82 | EXPORT_SYMBOL(phy_read); | ||
83 | |||
84 | /** | ||
85 | * phy_write - Convenience function for writing a given PHY register | ||
86 | * @phydev: the phy_device struct | ||
87 | * @regnum: register number to write | ||
88 | * @val: value to write to @regnum | ||
89 | * | ||
90 | * NOTE: MUST NOT be called from interrupt context, | ||
91 | * because the bus read/write functions may wait for an interrupt | ||
92 | * to conclude the operation. | ||
93 | */ | ||
94 | int phy_write(struct phy_device *phydev, u16 regnum, u16 val) | ||
95 | { | ||
96 | int err; | ||
97 | struct mii_bus *bus = phydev->bus; | ||
98 | |||
99 | BUG_ON(in_interrupt()); | ||
100 | |||
101 | mutex_lock(&bus->mdio_lock); | ||
102 | err = bus->write(bus, phydev->addr, regnum, val); | ||
103 | mutex_unlock(&bus->mdio_lock); | ||
104 | |||
105 | return err; | ||
106 | } | ||
107 | EXPORT_SYMBOL(phy_write); | ||
108 | |||
109 | /** | ||
110 | * phy_clear_interrupt - Ack the phy device's interrupt | 61 | * phy_clear_interrupt - Ack the phy device's interrupt |
111 | * @phydev: the phy_device struct | 62 | * @phydev: the phy_device struct |
112 | * | 63 | * |