diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2021-01-06 14:03:40 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-07 14:53:07 -0800 |
commit | e6e918d4eb93f43e770fbc2a0881686e350e1a1f (patch) | |
tree | 773a30cbea9d815d5faf396340272b2449b3c61f /drivers/net/phy/mdio_bus.c | |
parent | 8b86850bf9ef259e194ce49c776aded3b8c281fb (diff) |
net: phy: replace mutex_is_locked with lockdep_assert_held in phylib
Switch to lockdep_assert_held(_once), similar to what is being done
in other subsystems. One advantage is that there's zero runtime
overhead if lockdep support isn't enabled.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/ccc40b9d-8ee0-43a1-5009-2cc95ca79c85@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/mdio_bus.c')
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 2b42e46066b4..040509b81f02 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -740,7 +740,7 @@ int __mdiobus_read(struct mii_bus *bus, int addr, u32 regnum) { int retval; - WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock)); + lockdep_assert_held_once(&bus->mdio_lock); retval = bus->read(bus, addr, regnum); @@ -766,7 +766,7 @@ int __mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val) { int err; - WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock)); + lockdep_assert_held_once(&bus->mdio_lock); err = bus->write(bus, addr, regnum, val); |