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

dio: make dio_bus_type const

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

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240212-bus_cleanup-dio-v2-1-3b1ba4c0547d@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ricardo B. Marliere and committed by
Greg Kroah-Hartman
cb1c1224 c65f52fc

+2 -2
+1 -1
drivers/dio/dio-driver.c
··· 123 123 } 124 124 125 125 126 - struct bus_type dio_bus_type = { 126 + const struct bus_type dio_bus_type = { 127 127 .name = "dio", 128 128 .match = dio_bus_match, 129 129 .probe = dio_device_probe,
+1 -1
include/linux/dio.h
··· 68 68 }; 69 69 70 70 extern struct dio_bus dio_bus; /* Single DIO bus */ 71 - extern struct bus_type dio_bus_type; 71 + extern const struct bus_type dio_bus_type; 72 72 73 73 /* 74 74 * DIO device IDs