linux_dsm_epyc7002/drivers/net/ethernet/realtek
Bartosz Golaszewski ac3a68d566 net: phy: don't abuse devres in devm_mdiobus_register()
We currently have two managed helpers for mdiobus - devm_mdiobus_alloc()
and devm_mdiobus_register(). The idea behind devres is that the release
callback releases whatever resource the devm function allocates. In the
mdiobus case however there's no devres associated with the device by
devm_mdiobus_register(). Instead the release callback for
devm_mdiobus_alloc(): _devm_mdiobus_free() unregisters the device if
it is marked as managed.

This all seems wrong. The managed structure shouldn't need to know or
care about whether it's managed or not - and this is the case now for
struct mii_bus. The devres wrapper should be opaque to the managed
resource.

This changeset makes devm_mdiobus_alloc() and devm_mdiobus_register()
conform to common devres standards: devm_mdiobus_alloc() allocates a
devres structure and registers a callback that will call mdiobus_free().
__devm_mdiobus_register() allocated another devres and registers a
callback that will unregister the bus.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-06-30 15:57:34 -07:00
..
8139cp.c realtek/8139cp: use generic power management 2020-05-19 15:32:24 -07:00
8139too.c realtek/8139too: use generic power management 2020-05-19 15:32:24 -07:00
atp.c netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
atp.h
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile r8169: factor out PHY configuration to r8169_phy_config.c 2020-01-10 16:41:35 -08:00
r8169_firmware.c treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
r8169_firmware.h
r8169_main.c net: phy: don't abuse devres in devm_mdiobus_register() 2020-06-30 15:57:34 -07:00
r8169_phy_config.c r8169: sync support for RTL8401 with vendor driver 2020-06-28 20:56:38 -07:00
r8169.h r8169: sync support for RTL8401 with vendor driver 2020-06-28 20:56:38 -07:00