linux/Documentation/driver-api
Linus Torvalds 71a7507afb Driver Core changes for 6.2-rc1
Here is the set of driver core and kernfs changes for 6.2-rc1.
 
 The "big" change in here is the addition of a new macro,
 container_of_const() that will preserve the "const-ness" of a pointer
 passed into it.
 
 The "problem" of the current container_of() macro is that if you pass in
 a "const *", out of it can comes a non-const pointer unless you
 specifically ask for it.  For many usages, we want to preserve the
 "const" attribute by using the same call.  For a specific example, this
 series changes the kobj_to_dev() macro to use it, allowing it to be used
 no matter what the const value is.  This prevents every subsystem from
 having to declare 2 different individual macros (i.e.
 kobj_const_to_dev() and kobj_to_dev()) and having the compiler enforce
 the const value at build time, which having 2 macros would not do
 either.
 
 The driver for all of this have been discussions with the Rust kernel
 developers as to how to properly mark driver core, and kobject, objects
 as being "non-mutable".  The changes to the kobject and driver core in
 this pull request are the result of that, as there are lots of paths
 where kobjects and device pointers are not modified at all, so marking
 them as "const" allows the compiler to enforce this.
 
 So, a nice side affect of the Rust development effort has been already
 to clean up the driver core code to be more obvious about object rules.
 
 All of this has been bike-shedded in quite a lot of detail on lkml with
 different names and implementations resulting in the tiny version we
 have in here, much better than my original proposal.  Lots of subsystem
 maintainers have acked the changes as well.
 
 Other than this change, included in here are smaller stuff like:
   - kernfs fixes and updates to handle lock contention better
   - vmlinux.lds.h fixes and updates
   - sysfs and debugfs documentation updates
   - device property updates
 
 All of these have been in the linux-next tree for quite a while with no
 problems, OTHER than some merge issues with other trees that should be
 obvious when you hit them (block tree deletes a driver that this tree
 modifies, iommufd tree modifies code that this tree also touches).  If
 there are merge problems with these trees, please let me know.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCY5wz3A8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yks0ACeKYUlVgCsER8eYW+x18szFa2QTXgAn2h/VhZe
 1Fp53boFaQkGBjl8mGF8
 =v+FB
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is the set of driver core and kernfs changes for 6.2-rc1.

  The "big" change in here is the addition of a new macro,
  container_of_const() that will preserve the "const-ness" of a pointer
  passed into it.

  The "problem" of the current container_of() macro is that if you pass
  in a "const *", out of it can comes a non-const pointer unless you
  specifically ask for it. For many usages, we want to preserve the
  "const" attribute by using the same call. For a specific example, this
  series changes the kobj_to_dev() macro to use it, allowing it to be
  used no matter what the const value is. This prevents every subsystem
  from having to declare 2 different individual macros (i.e.
  kobj_const_to_dev() and kobj_to_dev()) and having the compiler enforce
  the const value at build time, which having 2 macros would not do
  either.

  The driver for all of this have been discussions with the Rust kernel
  developers as to how to properly mark driver core, and kobject,
  objects as being "non-mutable". The changes to the kobject and driver
  core in this pull request are the result of that, as there are lots of
  paths where kobjects and device pointers are not modified at all, so
  marking them as "const" allows the compiler to enforce this.

  So, a nice side affect of the Rust development effort has been already
  to clean up the driver core code to be more obvious about object
  rules.

  All of this has been bike-shedded in quite a lot of detail on lkml
  with different names and implementations resulting in the tiny version
  we have in here, much better than my original proposal. Lots of
  subsystem maintainers have acked the changes as well.

  Other than this change, included in here are smaller stuff like:

   - kernfs fixes and updates to handle lock contention better

   - vmlinux.lds.h fixes and updates

   - sysfs and debugfs documentation updates

   - device property updates

  All of these have been in the linux-next tree for quite a while with
  no problems"

* tag 'driver-core-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (58 commits)
  device property: Fix documentation for fwnode_get_next_parent()
  firmware_loader: fix up to_fw_sysfs() to preserve const
  usb.h: take advantage of container_of_const()
  device.h: move kobj_to_dev() to use container_of_const()
  container_of: add container_of_const() that preserves const-ness of the pointer
  driver core: fix up missed drivers/s390/char/hmcdrv_dev.c class.devnode() conversion.
  driver core: fix up missed scsi/cxlflash class.devnode() conversion.
  driver core: fix up some missing class.devnode() conversions.
  driver core: make struct class.devnode() take a const *
  driver core: make struct class.dev_uevent() take a const *
  cacheinfo: Remove of_node_put() for fw_token
  device property: Add a blank line in Kconfig of tests
  device property: Rename goto label to be more precise
  device property: Move PROPERTY_ENTRY_BOOL() a bit down
  device property: Get rid of __PROPERTY_ENTRY_ARRAY_EL*SIZE*()
  kernfs: fix all kernel-doc warnings and multiple typos
  driver core: pass a const * into of_device_uevent()
  kobject: kset_uevent_ops: make name() callback take a const *
  kobject: kset_uevent_ops: make filter() callback take a const *
  kobject: make kobject_namespace take a const *
  ...
2022-12-16 03:54:54 -08:00
..
80211 docs: net: 80211: reduce docs build time 2020-10-08 10:41:49 +02:00
acpi Documentation: ACPI: fix error script name 2021-06-17 13:21:48 -06:00
backlight
cxl Documentation: cxl: remove dangling kernel-doc reference 2022-08-05 08:41:02 -07:00
dmaengine dmaengine: remove DMA_MEMCPY_SG once again 2022-06-27 12:01:40 +05:30
driver-model Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
early-userspace Documentation: Fix intiramfs script name 2021-07-18 23:48:14 +09:00
firmware Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
fpga docs: fpga: mgr: document parse_header() callback 2022-06-24 12:12:24 +08:00
gpio Documentation: gpio: Remove text about ARCH_NR_GPIOS 2022-10-17 11:03:20 +02:00
hte tegra194-hte.rst: fix reference to its binding 2022-07-07 13:10:00 -06:00
i3c docs: driver-api: i3c: Replace HTTP links with HTTPS ones 2020-07-13 09:32:36 -06:00
iio docs: iio: mark "repeat" sysfs attribute as optional 2021-03-11 20:47:08 +00:00
md
media media: mc: entity: Rewrite media_pipeline_start() 2022-09-24 09:19:42 +02: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 docs: mmc: update maintainer name and URL 2021-10-28 11:54:54 +02:00
mtd Documentation / MTD: Rename the intel-spi driver 2022-02-14 12:53:10 +00:00
nfc nfc: constify nfc_llc_ops 2021-07-25 09:21:21 +01:00
nvdimm nvdimm/blk: Fix title level 2022-03-23 17:52:33 -07:00
pci PCI/MSI: Move code into a separate directory 2021-12-09 11:52:22 +01:00
phy
pldmfw Add pldmfw library for PLDM firmware update 2020-07-28 17:07:06 -07:00
pm docs: devices.rst: better reference documentation docs 2021-06-17 13:24:36 -06:00
rapidio Replace HTTP links with HTTPS ones: Documentation/driver-api 2020-06-26 11:09:04 -06:00
serial Documentation: Make formatting consistent for rs485 docs 2022-11-03 03:43:05 +01:00
soundwire docs: soundwire: fix some identation at stream.rst 2020-09-10 10:49:29 -06:00
surface_aggregator platform/surface: aggregator: Allow notifiers to avoid communication on unregistering 2022-06-13 17:25:07 +02:00
thermal docs: driver-api/thermal/intel_dptf: Use copyright symbol 2022-04-05 09:46:06 -06:00
tty Documentation: tty: n_gsm, use power of ReST 2022-04-14 18:24:24 +02:00
usb Docs: usb: update writesize, copy_from_user, usb_fill_bulk_urb, usb_submit_urb 2021-11-17 14:54:58 +01:00
xilinx firmware: xilinx: Remove zynqmp_pm_get_eemi_ops() in IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) 2021-03-01 12:52:07 +01:00
aperture.rst drm: Implement DRM aperture helpers under video/ 2022-06-27 11:07:55 +02:00
auxiliary_bus.rst Documentation/auxiliary_bus: Move the text into the code 2021-12-03 16:41:50 +01:00
basics.rst overflow: Fix kern-doc markup for functions 2022-10-25 14:57:42 -07:00
clk.rst
component.rst
connector.rst net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
console.rst
dcdbas.rst
devfreq.rst
device_link.rst docs: device_link.rst: remove duplicated kernel-doc include 2020-10-15 07:49:42 +02:00
device-io.rst dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
dma-buf.rst dma-buf: Document dynamic locking convention 2022-10-18 01:21:53 +03:00
edac.rst
eisa.rst Documentation: eisa: Fix typo 2022-11-15 14:52:38 -07:00
firewire.rst Documentation: fix firewire.rst ABI file path error 2022-01-20 17:01:32 -07:00
frame-buffer.rst
generic-counter.rst counter: Update documentation for new counter registration functions 2021-12-30 17:44:06 +01:00
hsi.rst
i2c.rst
index.rst drm: Implement DRM aperture helpers under video/ 2022-06-27 11:07:55 +02:00
infiniband.rst
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
io_ordering.rst
io-mapping.rst io-mapping: Provide iomap_local variant 2020-11-24 14:42:09 +01:00
ioctl.rst docs: driver-api: avoid using ReST :doc:foo markup 2021-06-17 13:24:37 -06:00
ipmb.rst
ipmi.rst ipmi: Add docs for the IPMI IPMB driver 2021-10-05 06:54:17 -05:00
isa.rst Remove duplicate words inside documentation 2022-09-27 13:21:43 -06:00
isapnp.rst
libata.rst libata: Improve ATA queued command allocation 2022-04-11 09:27:44 +09: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 docs/driver-api/miscellaneous: Remove kernel-doc of serial_core.c 2022-11-09 14:56:05 +01:00
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 doc: nvmem: Update example 2022-02-21 18:00:30 +01:00
parport-lowlevel.rst
pin-control.rst docs/pinctrl: fix runtime pinmuxing example 2022-11-09 09:27:53 +01:00
pps.rst
ptp.rst docs: ptp.rst: add support for Renesas (IDT) ClockMatrix 2020-07-17 10:25:21 -07:00
pwm.rst pwm: core: Get rid of unused devm_of_pwm_get() 2022-09-19 06:17:05 -07: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
s390-drivers.rst
scsi.rst
slimbus.rst
sm501.rst
spi.rst spi: Update reference to struct spi_controller 2022-11-01 18:30:09 +00:00
switchtec.rst
sync_file.rst
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: consolidate all the description sysfs into the core code 2022-10-04 12:06:58 -06:00
vfio-pci-device-specific-driver-acceptance.rst vfio-pci: Provide reviewers and acceptance criteria for variant drivers 2022-03-17 09:57:11 -06:00
vfio.rst vfio: Introduce a vfio_uninit_group_dev() API call 2021-08-11 09:50:10 -06:00
vme.rst vme: move back to staging 2022-06-10 15:38:14 +02:00
w1.rst
xillybus.rst Documentation/driver-api: xillybus: drop doubled word 2020-07-10 14:58:01 +02:00
zorro.rst