Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: gameport - make gameport_bus const

Now that the driver core can properly handle constant struct bus_type,
move the gameport_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>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-input-v1-1-74c2438801cf@marliere.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Ricardo B. Marliere and committed by
Dmitry Torokhov
d03f0301 7d0f351d

+2 -2
+2 -2
drivers/input/gameport/gameport.c
··· 38 38 39 39 static LIST_HEAD(gameport_list); 40 40 41 - static struct bus_type gameport_bus; 41 + static const struct bus_type gameport_bus; 42 42 43 43 static void gameport_add_port(struct gameport *gameport); 44 44 static void gameport_attach_driver(struct gameport_driver *drv); ··· 813 813 return !gameport_drv->ignore; 814 814 } 815 815 816 - static struct bus_type gameport_bus = { 816 + static const struct bus_type gameport_bus = { 817 817 .name = "gameport", 818 818 .dev_groups = gameport_device_groups, 819 819 .drv_groups = gameport_driver_groups,