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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman 2023-12-19 16:03:20 +01:00
parent 32f78abe59
commit dedb868994
2 changed files with 2 additions and 2 deletions

View File

@ -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,

View File

@ -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;