diff options
Diffstat (limited to 'drivers/usb/net/mcs7830.c')
-rw-r--r-- | drivers/usb/net/mcs7830.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/net/mcs7830.c b/drivers/usb/net/mcs7830.c index 23a80667f17e..6240b978fe3d 100644 --- a/drivers/usb/net/mcs7830.c +++ b/drivers/usb/net/mcs7830.c | |||
@@ -184,6 +184,7 @@ static int mcs7830_read_phy(struct usbnet *dev, u8 index) | |||
184 | HIF_REG_PHY_CMD2_PEND_FLAG_BIT | index, | 184 | HIF_REG_PHY_CMD2_PEND_FLAG_BIT | index, |
185 | }; | 185 | }; |
186 | 186 | ||
187 | mutex_lock(&dev->phy_mutex); | ||
187 | /* write the MII command */ | 188 | /* write the MII command */ |
188 | ret = mcs7830_set_reg(dev, HIF_REG_PHY_CMD1, 2, cmd); | 189 | ret = mcs7830_set_reg(dev, HIF_REG_PHY_CMD1, 2, cmd); |
189 | if (ret < 0) | 190 | if (ret < 0) |
@@ -208,6 +209,7 @@ static int mcs7830_read_phy(struct usbnet *dev, u8 index) | |||
208 | dev_dbg(&dev->udev->dev, "read PHY reg %02x: %04x (%d tries)\n", | 209 | dev_dbg(&dev->udev->dev, "read PHY reg %02x: %04x (%d tries)\n", |
209 | index, val, i); | 210 | index, val, i); |
210 | out: | 211 | out: |
212 | mutex_unlock(&dev->phy_mutex); | ||
211 | return ret; | 213 | return ret; |
212 | } | 214 | } |
213 | 215 | ||
@@ -222,6 +224,8 @@ static int mcs7830_write_phy(struct usbnet *dev, u8 index, u16 val) | |||
222 | HIF_REG_PHY_CMD2_PEND_FLAG_BIT | (index & 0x1F), | 224 | HIF_REG_PHY_CMD2_PEND_FLAG_BIT | (index & 0x1F), |
223 | }; | 225 | }; |
224 | 226 | ||
227 | mutex_lock(&dev->phy_mutex); | ||
228 | |||
225 | /* write the new register contents */ | 229 | /* write the new register contents */ |
226 | le_val = cpu_to_le16(val); | 230 | le_val = cpu_to_le16(val); |
227 | ret = mcs7830_set_reg(dev, HIF_REG_PHY_DATA, 2, &le_val); | 231 | ret = mcs7830_set_reg(dev, HIF_REG_PHY_DATA, 2, &le_val); |
@@ -248,6 +252,7 @@ static int mcs7830_write_phy(struct usbnet *dev, u8 index, u16 val) | |||
248 | dev_dbg(&dev->udev->dev, "write PHY reg %02x: %04x (%d tries)\n", | 252 | dev_dbg(&dev->udev->dev, "write PHY reg %02x: %04x (%d tries)\n", |
249 | index, val, i); | 253 | index, val, i); |
250 | out: | 254 | out: |
255 | mutex_unlock(&dev->phy_mutex); | ||
251 | return ret; | 256 | return ret; |
252 | } | 257 | } |
253 | 258 | ||