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

thunderbolt: make tb_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the tb_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Andreas Noever <andreas.noever@gmail.com>
Cc: Michael Jamet <michael.jamet@intel.com>
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
Cc: <linux-usb@vger.kernel.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/2023121904-utopia-broadcast-06d1@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2 -2
+1 -1
drivers/thunderbolt/domain.c
··· 307 307 NULL, 308 308 }; 309 309 310 - struct bus_type tb_bus_type = { 310 + const struct bus_type tb_bus_type = { 311 311 .name = "thunderbolt", 312 312 .match = tb_service_match, 313 313 .probe = tb_service_probe,
+1 -1
include/linux/thunderbolt.h
··· 86 86 unsigned long privdata[]; 87 87 }; 88 88 89 - extern struct bus_type tb_bus_type; 89 + extern const struct bus_type tb_bus_type; 90 90 extern struct device_type tb_service_type; 91 91 extern struct device_type tb_xdomain_type; 92 92