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

index 822a5cd05566647d2bea82e2e978d05d214f79b4..613cb356b918d71562e5d48d237d0f64137b7afb 100644 (file)
@@ -431,7 +431,7 @@ static void serdev_drv_remove(struct device *dev)
        dev_pm_domain_detach(dev, true);
 }
 
-static struct bus_type serdev_bus_type = {
+static const struct bus_type serdev_bus_type = {
        .name           = "serial",
        .match          = serdev_device_match,
        .probe          = serdev_drv_probe,