Skip to content

Commit fbd5f50

Browse files
rbmarlieredtor
authored andcommitted
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>
1 parent d1278c9 commit fbd5f50

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/input/serio/serio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ irqreturn_t serio_interrupt(struct serio *serio,
10071007
}
10081008
EXPORT_SYMBOL(serio_interrupt);
10091009

1010-
struct bus_type serio_bus = {
1010+
const struct bus_type serio_bus = {
10111011
.name = "serio",
10121012
.drv_groups = serio_driver_groups,
10131013
.match = serio_bus_match,

include/linux/serio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/mod_devicetable.h>
1616
#include <uapi/linux/serio.h>
1717

18-
extern struct bus_type serio_bus;
18+
extern const struct bus_type serio_bus;
1919

2020
struct serio {
2121
void *port_data;

0 commit comments

Comments
 (0)