sh: intc: Make intc_subsys const
authorRicardo B. Marliere <ricardo@marliere.net>
Thu, 8 Feb 2024 19:56:52 +0000 (16:56 -0300)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 15 Feb 2024 17:12:01 +0000 (18:12 +0100)
Now that the driver core can properly handle constant struct bus_type,
move the make intc_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20240208-bus_cleanup-sh2-v1-1-729277400893@marliere.net
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
drivers/sh/intc/core.c
drivers/sh/intc/internals.h

index ca4f4ca413f11d6b2c0a29ab528da14042f395d2..74350b5871dc8ecf627c6539170872741831436e 100644 (file)
@@ -455,7 +455,7 @@ struct syscore_ops intc_syscore_ops = {
        .resume         = intc_resume,
 };
 
-struct bus_type intc_subsys = {
+const struct bus_type intc_subsys = {
        .name           = "intc",
        .dev_name       = "intc",
 };
index fa73c173b56a60ffc34434c7f7fb54ae46374552..9b6cd1bebb4e305d733983c184677b8ec0fcb369 100644 (file)
@@ -160,7 +160,7 @@ void _intc_enable(struct irq_data *data, unsigned long handle);
 /* core.c */
 extern struct list_head intc_list;
 extern raw_spinlock_t intc_big_lock;
-extern struct bus_type intc_subsys;
+extern const struct bus_type intc_subsys;
 
 unsigned int intc_get_dfl_prio_level(void);
 unsigned int intc_get_prio_level(unsigned int irq);