]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fsi: make fsi_bus_type constant
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2025 12:07:01 +0000 (14:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jul 2025 12:28:21 +0000 (14:28 +0200)
Now that the driver core can properly handle constant struct bus_type,
move the fsi_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Ninad Palsule <ninad@linux.ibm.com>
Cc: linux-fsi@lists.ozlabs.org
Reviewed-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/2025070100-overblown-busily-a04b@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fsi/fsi-core.c
include/linux/fsi.h

index 50e8736039fe686dd402ecf8fabe37a4c237d71b..ee39d1699387ef1122745004e4ef0dd64a06a456 100644 (file)
@@ -1404,7 +1404,7 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv)
 }
 EXPORT_SYMBOL_GPL(fsi_driver_unregister);
 
-struct bus_type fsi_bus_type = {
+const struct bus_type fsi_bus_type = {
        .name           = "fsi",
        .match          = fsi_bus_match,
 };
index 8c5eef8087887b180490659d913d6fc0c51ecb51..adea1b432f2d21d9ce4236b4a84df93261b38083 100644 (file)
@@ -68,7 +68,7 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,
 extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr,
                const void *val, size_t size);
 
-extern struct bus_type fsi_bus_type;
+extern const struct bus_type fsi_bus_type;
 extern const struct device_type fsi_cdev_type;
 
 enum fsi_dev_type {