counter: make counter_bus_type const
authorRicardo B. Marliere <ricardo@marliere.net>
Sun, 4 Feb 2024 16:02:30 +0000 (13:02 -0300)
committerWilliam Breathitt Gray <wbg@kernel.org>
Tue, 2 Apr 2024 17:10:33 +0000 (13:10 -0400)
Now that the driver core can properly handle constant struct bus_type,
move the counter_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

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/20240204-bus_cleanup-counter-v1-1-cef9dd719bdc@marliere.net
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
drivers/counter/counter-core.c

index 3f24481fc04a1258624020a9a919f2d10640057a..29df0985f2ba08c027c55b62d9002ff91839aacc 100644 (file)
@@ -54,7 +54,7 @@ static struct device_type counter_device_type = {
        .release = counter_device_release,
 };
 
-static struct bus_type counter_bus_type = {
+static const struct bus_type counter_bus_type = {
        .name = "counter",
        .dev_name = "counter",
 };