linux/Documentation/driver-api
Jason Gunthorpe 2a3d15f270 vfio/mdev: Add missing typesafety around mdev_device
The mdev API should accept and pass a 'struct mdev_device *' in all
places, not pass a 'struct device *' and cast it internally with
to_mdev_device(). Particularly in its struct mdev_driver functions, the
whole point of a bus's struct device_driver wrapper is to provide type
safety compared to the default struct device_driver.

Further, the driver core standard is for bus drivers to expose their
device structure in their public headers that can be used with
container_of() inlines and '&foo->dev' to go between the class levels, and
'&foo->dev' to be used with dev_err/etc driver core helper functions. Move
'struct mdev_device' to mdev.h

Once done this allows moving some one instruction exported functions to
static inlines, which in turns allows removing one of the two grotesque
symbol_get()'s related to mdev in the core code.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Message-Id: <3-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2021-04-07 15:39:16 -06:00
..
80211 docs: net: 80211: reduce docs build time 2020-10-08 10:41:49 +02: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
cxl cxl/mem: Add basic IOCTL interface 2021-02-16 20:36:38 -08:00
dmaengine dmaengine: doc: client: Update for dmaengine_get_dma_device() usage 2020-12-11 21:20:08 +05:30
driver-model rtc: rework rtc_register_device() resource management 2020-11-19 12:50:12 +01:00
early-userspace Replace HTTP links with HTTPS ones: Documentation/driver-api 2020-06-26 11:09:04 -06:00
firmware docs: driver-api: firmware: fallback-mechanisms: Fix rendering of bullet point 2020-09-08 13:32:06 +02:00
fpga docs: fpga: replace :c:member: macros 2020-10-15 07:49:43 +02:00
gpio It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
i3c docs: driver-api: i3c: Replace HTTP links with HTTPS ones 2020-07-13 09:32:36 -06:00
iio docs: get rid of :c:type explicit declarations for structs 2020-10-15 07:49:40 +02:00
md docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
media media: Remove the legacy v4l2-clk API 2021-02-06 09:39:44 +01:00
mei docs updates for v5.10-rc1 2020-10-16 15:02:21 -07:00
memory-devices Replace HTTP links with HTTPS ones: Documentation/driver-api 2020-06-26 11:09:04 -06:00
mmc Replace HTTP links with HTTPS ones: Documentation/driver-api 2020-06-26 11:09:04 -06:00
mtd MTD core: 2020-12-16 14:58:35 -08:00
nfc docs: add SPDX tags to new index files 2019-07-15 11:03:03 -03:00
nvdimm docs: add some new files to their respective index.rst files 2020-09-10 10:48:20 -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
pldmfw Add pldmfw library for PLDM firmware update 2020-07-28 17:07:06 -07:00
pm docs: devices.rst: fix a C reference markup 2020-10-15 07:49:44 +02:00
rapidio Replace HTTP links with HTTPS ones: Documentation/driver-api 2020-06-26 11:09:04 -06:00
serial tty: vt: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
soundwire docs: soundwire: fix some identation at stream.rst 2020-09-10 10:49:29 -06:00
surface_aggregator platform/surface: Add Surface ACPI Notify driver 2021-01-07 00:06:39 +01:00
thermal It has been a relatively quiet cycle in docsland. 2021-02-22 10:57:46 -08:00
usb usb: docs: document altmode register/unregister functions 2020-10-15 07:49:48 +02:00
xilinx docs: driver-api: add xilinx driver API documentation 2019-07-15 11:03:02 -03:00
auxiliary_bus.rst devlink: Extend devlink port documentation for subfunctions 2021-01-22 11:32:11 -08:00
basics.rst docs: basics.rst: avoid duplicated C function declaration 2020-10-15 07:49:45 +02:00
clk.rst docs: clk: fix struct syntax 2019-06-07 11:35:15 -06:00
component.rst drm/doc: document recommended component helper usage 2019-02-19 12:22:24 +01:00
connector.rst net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08: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_link.rst docs: device_link.rst: remove duplicated kernel-doc include 2020-10-15 07:49:42 +02:00
device-io.rst Driver-API: Documentation: Replace deprecated :c:func: Usage 2020-07-13 09:56:03 -06:00
dma-buf.rst dma-buf: Fix kerneldoc formatting 2020-12-15 10:57:29 +01:00
edac.rst
eisa.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
firewire.rst FireWire: add driver-api Introduction section 2018-09-06 09:41:16 -06:00
frame-buffer.rst
generic-counter.rst Documentation/driver-api: generic-counter: drop doubled word 2020-07-07 20:24:07 +01:00
hsi.rst
i2c.rst
index.rst Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
infiniband.rst RDMA/core: Remove FMR pool API 2020-06-02 20:32:53 -03:00
infrastructure.rst docs: infrastructure.rst: exclude device_link_state from device.h 2020-10-15 07:49:46 +02:00
input.rst Input: remove input_polled_dev implementation 2020-12-02 12:35:14 -08:00
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 io-mapping: Provide iomap_local variant 2020-11-24 14:42:09 +01: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 Minor cleanups to the IPMI driver for 5.9 2020-08-08 09:32:18 -07: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 docs: libata.rst: fix a wrong usage of :c:type: tag 2020-10-15 07:49:44 +02:00
lightnvm-pblk.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
mailbox.rst docs: move mailbox.txt to driver-api and rename it 2020-06-26 11:33:38 -06:00
men-chameleon-bus.rst Documentation: document dma device use for mcb 2021-01-11 13:26:13 -07:00
message-based.rst
misc_devices.rst
miscellaneous.rst
mtdnand.rst docs: mtd: Avoid htmldocs warnings 2020-12-10 22:37:32 +01:00
ntb.rst Documentation/driver-api: ntb: drop doubled word 2020-07-13 11:18:17 -06: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
ptp.rst docs: ptp.rst: add support for Renesas (IDT) ClockMatrix 2020-07-17 10:25:21 -07:00
pwm.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
regulator.rst docs: get rid of :c:type explicit declarations for structs 2020-10-15 07:49:40 +02:00
reset.rst docs: add a reset controller chapter to the driver API docs 2020-12-08 10:48:04 -07:00
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 slimbus: stream: add stream support 2018-07-07 17:25:23 +02:00
sm501.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
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: scsi: target.rst: remove iSCSI transport class kernel-doc markup 2020-10-15 07:49:42 +02:00
uio-howto.rst Documentation/driver-api: uio-howto: drop doubled word 2020-07-10 14:58:01 +02:00
vfio-mediated-device.rst vfio/mdev: Add missing typesafety around mdev_device 2021-04-07 15:39:16 -06:00
vfio.rst vfio: Remove device_data from the vfio bus driver API 2021-04-06 11:55:11 -06:00
vme.rst
w1.rst docs: driver-api: address duplicate label warning 2020-04-07 13:41:34 -06:00
xillybus.rst Documentation/driver-api: xillybus: drop doubled word 2020-07-10 14:58:01 +02:00
zorro.rst docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00