linux-mainline/drivers/firewire
Greg Kroah-Hartman d69d804845 driver core: have match() callback in struct bus_type take a const *
In the match() callback, the struct device_driver * should not be
changed, so change the function callback to be a const *.  This is one
step of many towards making the driver core safe to have struct
device_driver in read-only memory.

Because the match() callback is in all busses, all busses are modified
to handle this properly.  This does entail switching some container_of()
calls to container_of_const() to properly handle the constant *.

For some busses, like PCI and USB and HV, the const * is cast away in
the match callback as those busses do want to modify those structures at
this point in time (they have a local lock in the driver structure.)
That will have to be changed in the future if they wish to have their
struct device * in read-only-memory.

Cc: Rafael J. Wysocki <rafael@kernel.org>
Reviewed-by: Alex Elder <elder@kernel.org>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
Link: https://lore.kernel.org/r/2024070136-wrongdoer-busily-01e8@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-03 15:16:54 +02:00
..
.kunitconfig firewire: core: add common inline functions to serialize/deserialize asynchronous packet header 2024-05-06 11:06:04 +09:00
core-card.c firewire: core: record card index in tracepoinrts events derived from bus_reset_arrange_template 2024-06-15 14:59:17 +09:00
core-cdev.c firewire: core: record card index in async_phy_outbound_complete tracepoints event 2024-06-15 14:59:17 +09:00
core-device.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
core-iso.c
core-topology.c firewire: core: record card index in bus_reset_handle tracepoints event 2024-06-15 14:59:26 +09:00
core-trace.c firewire: core: add support for Linux kernel tracepoints 2024-05-06 11:06:05 +09:00
core-transaction.c firewire: core: record card index in async_phy_inbound tracepoints event 2024-06-15 14:59:17 +09:00
core.h Revert "firewire: core: option to log bus reset initiation" 2024-05-06 11:06:06 +09:00
device-attribute-test.c firewire: core: fill model field in modalias of unit device for legacy layout of configuration ROM 2024-01-10 18:37:13 +09:00
init_ohci1394_dma.c
Kconfig firewire: fix website URL in Kconfig 2024-06-15 14:59:04 +09:00
Makefile firewire: obsolete usage of *-objs in Makefile for KUnit test 2024-05-09 08:06:22 +09:00
net.c firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-06-24 14:03:46 +09:00
nosy-user.h
nosy.c firewire: nosy: ensure user_length is taken into account when fetching packet contents 2024-04-29 18:35:55 +09:00
nosy.h
ohci.c firewire: ohci: obsolete OHCI_PARAM_DEBUG_BUSRESETS from debug module parameter 2024-05-06 11:06:06 +09:00
ohci.h
packet-header-definitions.h firewire: core: add common macro to serialize/deserialize isochronous packet header 2024-05-06 11:06:05 +09:00
packet-serdes-test.c firewire: add missing MODULE_DESCRIPTION() to test modules 2024-05-27 07:34:58 +09:00
sbp2.c scsi: sbp2: Switch to using ->device_configure 2024-04-11 21:37:49 -04:00
uapi-test.c firewire: add missing MODULE_DESCRIPTION() to test modules 2024-05-27 07:34:58 +09:00