Skip to content

Commit dd72c85

Browse files
oleremNipaLocal
authored andcommitted
net: usb: lan78xx: rename phy_mutex to mdiobus_mutex
Rename `phy_mutex` to `mdiobus_mutex` for clarity, as the mutex protects MDIO bus access rather than PHY-specific operations. Update all references to ensure consistency. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: NipaLocal <nipa@local>
1 parent a48f112 commit dd72c85

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/net/usb/lan78xx.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ struct lan78xx_net {
439439
struct usb_anchor deferred;
440440

441441
struct mutex dev_mutex; /* serialise open/stop wrt suspend/resume */
442-
struct mutex phy_mutex; /* for phy access */
442+
struct mutex mdiobus_mutex; /* for MDIO bus access */
443443
unsigned int pipe_in, pipe_out, pipe_intr;
444444

445445
unsigned int bulk_in_delay;
@@ -952,7 +952,7 @@ static int lan78xx_flush_rx_fifo(struct lan78xx_net *dev)
952952
return lan78xx_flush_fifo(dev, FCT_RX_CTL, FCT_RX_CTL_RST_);
953953
}
954954

955-
/* Loop until the read is completed with timeout called with phy_mutex held */
955+
/* Loop until the read is completed with timeout called with mdiobus_mutex held */
956956
static int lan78xx_mdiobus_wait_not_busy(struct lan78xx_net *dev)
957957
{
958958
unsigned long start_time = jiffies;
@@ -1596,7 +1596,7 @@ static int lan78xx_mac_reset(struct lan78xx_net *dev)
15961596
u32 val;
15971597
int ret;
15981598

1599-
mutex_lock(&dev->phy_mutex);
1599+
mutex_lock(&dev->mdiobus_mutex);
16001600

16011601
/* Resetting the device while there is activity on the MDIO
16021602
* bus can result in the MAC interface locking up and not
@@ -1631,7 +1631,7 @@ static int lan78xx_mac_reset(struct lan78xx_net *dev)
16311631

16321632
ret = -ETIMEDOUT;
16331633
exit_unlock:
1634-
mutex_unlock(&dev->phy_mutex);
1634+
mutex_unlock(&dev->mdiobus_mutex);
16351635

16361636
return ret;
16371637
}
@@ -2249,7 +2249,7 @@ static int lan78xx_mdiobus_read(struct mii_bus *bus, int phy_id, int idx)
22492249
if (ret < 0)
22502250
return ret;
22512251

2252-
mutex_lock(&dev->phy_mutex);
2252+
mutex_lock(&dev->mdiobus_mutex);
22532253

22542254
/* confirm MII not busy */
22552255
ret = lan78xx_mdiobus_wait_not_busy(dev);
@@ -2273,7 +2273,7 @@ static int lan78xx_mdiobus_read(struct mii_bus *bus, int phy_id, int idx)
22732273
ret = (int)(val & 0xFFFF);
22742274

22752275
done:
2276-
mutex_unlock(&dev->phy_mutex);
2276+
mutex_unlock(&dev->mdiobus_mutex);
22772277
usb_autopm_put_interface(dev->intf);
22782278

22792279
return ret;
@@ -2290,7 +2290,7 @@ static int lan78xx_mdiobus_write(struct mii_bus *bus, int phy_id, int idx,
22902290
if (ret < 0)
22912291
return ret;
22922292

2293-
mutex_lock(&dev->phy_mutex);
2293+
mutex_lock(&dev->mdiobus_mutex);
22942294

22952295
/* confirm MII not busy */
22962296
ret = lan78xx_mdiobus_wait_not_busy(dev);
@@ -2313,7 +2313,7 @@ static int lan78xx_mdiobus_write(struct mii_bus *bus, int phy_id, int idx,
23132313
goto done;
23142314

23152315
done:
2316-
mutex_unlock(&dev->phy_mutex);
2316+
mutex_unlock(&dev->mdiobus_mutex);
23172317
usb_autopm_put_interface(dev->intf);
23182318
return ret;
23192319
}
@@ -4476,7 +4476,7 @@ static int lan78xx_probe(struct usb_interface *intf,
44764476
skb_queue_head_init(&dev->rxq_done);
44774477
skb_queue_head_init(&dev->txq_pend);
44784478
skb_queue_head_init(&dev->rxq_overflow);
4479-
mutex_init(&dev->phy_mutex);
4479+
mutex_init(&dev->mdiobus_mutex);
44804480
mutex_init(&dev->dev_mutex);
44814481

44824482
ret = lan78xx_urb_config_init(dev);

0 commit comments

Comments
 (0)