Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drivers: rapidio: make rio_bus_type const

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>

authored by

Adrian Barnaś and committed by
Greg Kroah-Hartman
8ce6b508 61e60630

+2 -2
+1 -1
drivers/rapidio/rio-driver.c
··· 227 227 }; 228 228 EXPORT_SYMBOL_GPL(rio_mport_class); 229 229 230 - struct bus_type rio_bus_type = { 230 + const struct bus_type rio_bus_type = { 231 231 .name = "rapidio", 232 232 .match = rio_match_bus, 233 233 .dev_groups = rio_dev_groups,
+1 -1
include/linux/rio.h
··· 78 78 #define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */ 79 79 #define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */ 80 80 81 - extern struct bus_type rio_bus_type; 81 + extern const struct bus_type rio_bus_type; 82 82 extern struct class rio_mport_class; 83 83 84 84 struct rio_mport;