linux-stable/drivers/base
Greg Kroah-Hartman 884f8ce42c driver core: class: implement class_get/put without the private pointer.
Much like what was done in commit 273afac615 ("driver core: bus:
implement bus_get/put() without the private pointer"), it is time to
move the driver core away from using the internal private pointer in
struct class in order to enable it to be always a constant and be placed
in read-only memory in the future.

First step in doing this is to create a helper function that turns a
'struct class' into 'struct subsys_private' called class_to_subsys().

class_to_subsys() walks the list of registered busses in the system and
finds the matching one based on the pointer to the class itself.  As
this is a short list, and this function is not on any fast path, it
should not be noticable.

Implement class_get() and class_put() using this new helper function.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230325194234.46588-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-29 07:55:07 +02:00
..
firmware_loader driver core: class: mark the struct class for sysfs callbacks as constant 2023-03-29 07:54:58 +02:00
power driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
regmap Merge remote-tracking branch 'regmap/for-6.3' into regmap-next 2023-02-17 02:14:50 +00:00
test Merge 6.2-rc5 into driver-core-next 2023-01-22 12:56:55 +01:00
arch_numa.c
arch_topology.c arch_topology: Build cacheinfo from primary CPU 2023-01-18 09:58:40 +00:00
attribute_container.c
auxiliary.c driver core: make struct bus_type.uevent() take a const * 2023-01-27 13:45:52 +01:00
base.h driver core: move sysfs_dev_char_kobj out of class.h 2023-03-27 18:24:29 +02:00
bus.c driver core: bus: constify bus_get() 2023-03-23 13:21:24 +01:00
cacheinfo.c cacheinfo: Initialize variables in fetch_cache_info() 2023-01-31 16:02:02 +01:00
class.c driver core: class: implement class_get/put without the private pointer. 2023-03-29 07:55:07 +02:00
component.c drivers: base: component: fix memory leak with using debugfs_lookup() 2023-02-08 13:33:10 +01:00
container.c
core.c driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT 2023-03-28 18:45:59 +02:00
cpu.c driver core: cpu: don't hand-override the uevent bus_type callback. 2023-02-11 11:50:41 +01:00
dd.c driver core: Make state_synced device attribute writeable 2023-03-10 09:06:22 +01:00
devcoredump.c driver core: class: mark the struct class for sysfs callbacks as constant 2023-03-29 07:54:58 +02:00
devres.c devres: Pass unique name of the resource to devm_add_action() 2023-03-10 09:06:22 +01:00
devtmpfs.c Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
driver.c driver core: create bus_is_registered() 2023-02-09 10:43:35 +01:00
firmware.c
hypervisor.c
init.c init: Initialize noop_backing_dev_info early 2022-06-16 10:55:57 +02:00
isa.c
Kconfig driver core: Add CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT 2023-03-28 18:45:59 +02:00
Makefile genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
map.c
memory.c drivers/base/memory: Fix comments for phys_index_show() 2023-01-20 14:15:00 +01:00
module.c
node.c mm: memory-failure: add memory failure stats to sysfs 2023-02-02 22:33:28 -08:00
physical_location.c driver core: location: Free struct acpi_pld_info *pld before return false 2023-01-20 14:20:30 +01:00
physical_location.h driver core: physical_location.h remove extern from function prototypes 2023-03-24 15:35:48 +01:00
pinctrl.c
platform-msi.c genirq/msi, platform-msi: Ensure that MSI descriptors are unreferenced 2023-03-02 18:09:44 +01:00
platform.c driver core: platform: simplify __platform_driver_probe() 2023-02-01 14:08:10 +01:00
property.c device property: Constify a few fwnode APIs 2023-03-24 13:37:20 +01:00
soc.c driver core: soc: remove layering violation for the soc_bus 2023-01-31 09:09:53 +01:00
swnode.c driver core: make kobj_type structures constant 2023-02-08 13:34:30 +01:00
syscore.c
topology.c drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist 2022-07-15 17:36:33 +02:00
trace.c
trace.h
transport_class.c drivers: base: transport_class: fix resource leak when transport_add_device() fails 2023-01-20 14:22:53 +01:00