]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drivers: rapidio: make rio_bus_type const
authorAdrian Barnaś <abarnas@google.com>
Fri, 19 Sep 2025 07:32:01 +0000 (07:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Oct 2025 05:55:02 +0000 (07:55 +0200)
Because driver core can properly handle constant struct bus_type,
move the rio_bus_type to be a constant structure as well, placing it into
read-only memory which can not be modified at runtime.

Signed-off-by: Adrian Barnaś <abarnas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20250919073201.751348-1-abarnas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rapidio/rio-driver.c
include/linux/rio.h

index 238250e690059527f452834d566851e85086a04c..bcfe0b45b377e32455b80f339c39de458ecbaeb9 100644 (file)
@@ -227,7 +227,7 @@ struct class rio_mport_class = {
 };
 EXPORT_SYMBOL_GPL(rio_mport_class);
 
-struct bus_type rio_bus_type = {
+const struct bus_type rio_bus_type = {
        .name = "rapidio",
        .match = rio_match_bus,
        .dev_groups = rio_dev_groups,
index 3c29f40f3c94b4cd16f7a89bc1171c02db63d2db..2c29f21ba9e5ecc13133ecb9d03deb53f2a2cab1 100644 (file)
@@ -78,7 +78,7 @@
 #define RIO_CTAG_RESRVD        0xfffe0000 /* Reserved */
 #define RIO_CTAG_UDEVID        0x0001ffff /* Unique device identifier */
 
-extern struct bus_type rio_bus_type;
+extern const struct bus_type rio_bus_type;
 extern struct class rio_mport_class;
 
 struct rio_mport;