Commit dedb8689 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

driver core: container: make container_subsys const

Now that the driver core can properly handle constant struct bus_type,
move the container_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/2023121919-chatter-grumbling-9ef3@gregkh


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 32f78abe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ static int container_offline(struct device *dev)
	return cdev->offline ? cdev->offline(cdev) : 0;
}

struct bus_type container_subsys = {
const struct bus_type container_subsys = {
	.name = CONTAINER_BUS_NAME,
	.dev_name = CONTAINER_BUS_NAME,
	.online = trivial_online,
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#include <linux/device.h>

/* drivers/base/power/container.c */
extern struct bus_type container_subsys;
extern const struct bus_type container_subsys;

struct container_dev {
	struct device dev;