diff options
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index d39ae77707ef..478405e544cc 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -135,9 +135,7 @@ static int mdio_bus_phy_resume(struct device *dev) | |||
135 | if (!mdio_bus_phy_may_suspend(phydev)) | 135 | if (!mdio_bus_phy_may_suspend(phydev)) |
136 | goto no_resume; | 136 | goto no_resume; |
137 | 137 | ||
138 | mutex_lock(&phydev->lock); | ||
139 | ret = phy_resume(phydev); | 138 | ret = phy_resume(phydev); |
140 | mutex_unlock(&phydev->lock); | ||
141 | if (ret < 0) | 139 | if (ret < 0) |
142 | return ret; | 140 | return ret; |
143 | 141 | ||
@@ -1041,9 +1039,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
1041 | if (err) | 1039 | if (err) |
1042 | goto error; | 1040 | goto error; |
1043 | 1041 | ||
1044 | mutex_lock(&phydev->lock); | ||
1045 | phy_resume(phydev); | 1042 | phy_resume(phydev); |
1046 | mutex_unlock(&phydev->lock); | ||
1047 | phy_led_triggers_register(phydev); | 1043 | phy_led_triggers_register(phydev); |
1048 | 1044 | ||
1049 | return err; | 1045 | return err; |
@@ -1172,7 +1168,7 @@ int phy_suspend(struct phy_device *phydev) | |||
1172 | } | 1168 | } |
1173 | EXPORT_SYMBOL(phy_suspend); | 1169 | EXPORT_SYMBOL(phy_suspend); |
1174 | 1170 | ||
1175 | int phy_resume(struct phy_device *phydev) | 1171 | int __phy_resume(struct phy_device *phydev) |
1176 | { | 1172 | { |
1177 | struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver); | 1173 | struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver); |
1178 | int ret = 0; | 1174 | int ret = 0; |
@@ -1189,6 +1185,18 @@ int phy_resume(struct phy_device *phydev) | |||
1189 | 1185 | ||
1190 | return ret; | 1186 | return ret; |
1191 | } | 1187 | } |
1188 | EXPORT_SYMBOL(__phy_resume); | ||
1189 | |||
1190 | int phy_resume(struct phy_device *phydev) | ||
1191 | { | ||
1192 | int ret; | ||
1193 | |||
1194 | mutex_lock(&phydev->lock); | ||
1195 | ret = __phy_resume(phydev); | ||
1196 | mutex_unlock(&phydev->lock); | ||
1197 | |||
1198 | return ret; | ||
1199 | } | ||
1192 | EXPORT_SYMBOL(phy_resume); | 1200 | EXPORT_SYMBOL(phy_resume); |
1193 | 1201 | ||
1194 | int phy_loopback(struct phy_device *phydev, bool enable) | 1202 | int phy_loopback(struct phy_device *phydev, bool enable) |