linux/Documentation/driver-api
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
..
80211 docs: prevent warnings due to autosectionlabel 2020-03-20 17:01:29 -06:00
acpi Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
backlight docs: lp855x-driver.rst: add it to the driver-api book 2019-07-15 11:03:02 -03:00
dmaengine This has been a busy cycle for documentation work. Highlights include: 2020-03-30 12:45:23 -07:00
driver-model net: phy: don't abuse devres in devm_mdiobus_register() 2020-06-30 15:57:34 -07:00
early-userspace docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
firmware Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2020-03-30 16:13:08 -07:00
fpga
gpio gpiolib: Add support for GPIO lookup by line name 2020-05-18 10:12:42 +02:00
i3c
iio iio: core: drop devm_iio_trigger_free() API call 2020-04-19 16:56:37 +01:00
md docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
media Documentation: media: convert to use i2c_new_client_device() 2020-06-19 09:20:25 +02:00
mei mei: docs: update mei documentation 2019-06-06 16:51:37 +02:00
memory-devices docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
mmc docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
mtd docs: mtd: Update spi nor reference driver 2019-09-06 08:51:39 -06:00
nfc docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
nvdimm doc: nvdimm: remove reference to non-existent CONFIG_NFIT_TEST 2020-04-28 12:46:07 -06:00
pci Documentation: Kill all references to mmiowb() 2019-04-08 12:00:45 +01:00
phy docs: phy: Drop duplicate 'be made' 2019-07-26 08:15:26 -06:00
pm Merge branch 'pm-cpuidle' 2020-06-01 15:19:30 +02:00
rapidio docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
serial tty: n_gsm: add ioctl to map serial device to mux'ed tty 2019-09-04 12:43:54 +02:00
soundwire soundwire: bus: rename sdw_bus_master_add/delete, add arguments 2020-05-19 12:44:34 +05:30
thermal doc: thermal: add cpu-idle-cooling to index tree 2020-05-05 09:57:14 -06:00
usb Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
xilinx docs: driver-api: add xilinx driver API documentation 2019-07-15 11:03:02 -03:00
basics.rst docs: Do not seek comments in kernel/rcu/tree_plugin.h 2019-05-24 14:23:40 -06:00
clk.rst docs: clk: fix struct syntax 2019-06-07 11:35:15 -06:00
component.rst
connector.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
console.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
dcdbas.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
devfreq.rst docs: Add initial documentation for devfreq 2019-11-19 13:16:53 -07:00
device_connection.rst
device_link.rst driver core: Add support for linking devices during device addition 2019-10-04 17:29:50 +02:00
device-io.rst Documentation: Kill all references to mmiowb() 2019-04-08 12:00:45 +01:00
dma-buf.rst dma-buf: Couple of documentation typo fixes 2020-04-20 17:00:34 -06:00
edac.rst
eisa.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
firewire.rst
frame-buffer.rst
generic-counter.rst docs: driver-api: generic-counter: Update Count and Signal data types 2019-10-18 19:47:38 +01:00
hsi.rst
i2c.rst
index.rst media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
infiniband.rst RDMA/core: Remove FMR pool API 2020-06-02 20:32:53 -03:00
infrastructure.rst docs: No structured comments in kernel/dma/coherent.c 2019-10-01 08:43:21 -06:00
input.rst
interconnect.rst interconnect: Add interconnect_graph file to debugfs 2019-12-16 09:49:54 +02:00
io_ordering.rst Documentation: Add io_ordering.rst to driver-api manual 2020-03-10 11:33:19 -06:00
io-mapping.rst Documentation: Add io-mapping.rst to driver-api manual 2020-03-10 11:33:15 -06:00
ioctl.rst docs: move core-api/ioctl.rst to driver-api/ 2020-03-10 11:21:08 -06:00
ipmb.rst drivers: ipmi: Support raw i2c packet in IPMB 2019-12-11 13:21:36 -06:00
ipmi.rst docs: move IPMI.txt to the driver API book 2020-05-15 11:55:04 -06:00
isa.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
isapnp.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
libata.rst scsi: docs: convert scsi_eh.txt to ReST 2020-03-11 23:08:01 -04:00
lightnvm-pblk.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
men-chameleon-bus.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
message-based.rst
misc_devices.rst
miscellaneous.rst
mtdnand.rst mtd: rawnand: Stop using nand_release() 2020-05-31 10:53:40 +02:00
ntb.rst New feature to add support for NTB virtual MSI interrupts, the ability 2019-07-21 09:46:59 -07:00
nvmem.rst nvmem: core: add nvmem_device_find 2019-10-07 09:47:37 -07:00
parport-lowlevel.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
pinctl.rst docs/pinctrl: fix compile errors in example code 2019-07-29 00:20:09 +02:00
pps.rst docs: driver-api: add remaining converted dirs to it 2019-07-15 11:03:03 -03:00
pti_intel_mid.rst docs: driver-api: pti_intel_mid: Enable syntax highlighting for C code block 2019-10-18 09:40:13 -06:00
ptp.rst docs: driver-api: add remaining converted dirs to it 2019-07-15 11:03:03 -03:00
pwm.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
regulator.rst
rfkill.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
s390-drivers.rst docs: s390: convert docs to ReST and rename to *.rst 2019-06-11 09:48:14 +02:00
scsi.rst
slimbus.rst
sm501.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
smsc_ece1099.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
sound.rst
spi.rst
switchtec.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
sync_file.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
target.rst docs: No structured comments in target_core_device.c 2019-05-24 15:01:30 -06:00
uio-howto.rst uio: Documentation: Add information on using uio_pdrv_genirq with DT 2019-09-04 13:42:43 +02:00
vfio-mediated-device.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
vfio.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
vme.rst
w1.rst docs: driver-api: address duplicate label warning 2020-04-07 13:41:34 -06:00
xillybus.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
zorro.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00