Input: serio - make serio_bus const

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

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240210-bus_cleanup-input2-v1-2-0daef7e034e0@marliere.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Ricardo B. Marliere 2024-03-03 15:05:42 -08:00 committed by Dmitry Torokhov
parent d1278c91fe
commit fbd5f5008f
2 changed files with 2 additions and 2 deletions

View File

@ -1007,7 +1007,7 @@ irqreturn_t serio_interrupt(struct serio *serio,
} }
EXPORT_SYMBOL(serio_interrupt); EXPORT_SYMBOL(serio_interrupt);
struct bus_type serio_bus = { const struct bus_type serio_bus = {
.name = "serio", .name = "serio",
.drv_groups = serio_driver_groups, .drv_groups = serio_driver_groups,
.match = serio_bus_match, .match = serio_bus_match,

View File

@ -15,7 +15,7 @@
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <uapi/linux/serio.h> #include <uapi/linux/serio.h>
extern struct bus_type serio_bus; extern const struct bus_type serio_bus;
struct serio { struct serio {
void *port_data; void *port_data;