]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: add device-managed devm_mdiobus_register
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 20 Apr 2020 21:29:05 +0000 (23:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Apr 2020 19:19:54 +0000 (12:19 -0700)
commit44aaee6ec8a2e0bce92d40229ef55c3b4adc6769
treee4047255c001aa5a57eb5c49edf6b5837823be20
parent8aea8672e390414b2017d5a9d8499d4826836757
net: phy: add device-managed devm_mdiobus_register

If there's no special ordering requirement for mdiobus_unregister(),
then driver code can be simplified by using a device-managed version
of mdiobus_register(). Prerequisite is that bus allocation has been
done device-managed too. Else mdiobus_free() may be called whilst
bus is still registered, resulting in a BUG_ON(). Therefore let
devm_mdiobus_register() return -EPERM if bus was allocated
non-managed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio_bus.c
include/linux/phy.h