Skip to content

Commit d03f030

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/input/gameport/gameport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static DEFINE_MUTEX(gameport_mutex);
3838

3939
static LIST_HEAD(gameport_list);
4040

41-
static struct bus_type gameport_bus;
41+
static const struct bus_type gameport_bus;
4242

4343
static void gameport_add_port(struct gameport *gameport);
4444
static void gameport_attach_driver(struct gameport_driver *drv);
@@ -813,7 +813,7 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv)
813813
return !gameport_drv->ignore;
814814
}
815815

816-
static struct bus_type gameport_bus = {
816+
static const struct bus_type gameport_bus = {
817817
.name = "gameport",
818818
.dev_groups = gameport_device_groups,
819819
.drv_groups = gameport_driver_groups,

0 commit comments

Comments
 (0)