serial: core: make serial_base_bus_type const
authorRicardo B. Marliere <ricardo@marliere.net>
Sat, 3 Feb 2024 19:14:51 +0000 (16:14 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Feb 2024 14:35:42 +0000 (14:35 +0000)
Now that the driver core can properly handle constant struct bus_type,
move the serial_base_bus_type 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/20240203-bus_cleanup-tty-v1-2-86b698c82efe@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_base_bus.c

index 3dfcf20c4eb68c99b71ab06e7c1c1c8925f4261a..4df2a4b10445adde43e83d4b8bd8543a132a1872 100644 (file)
@@ -41,7 +41,7 @@ static int serial_base_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static struct bus_type serial_base_bus_type = {
+static const struct bus_type serial_base_bus_type = {
        .name = "serial-base",
        .match = serial_base_match,
 };