]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drivers: eisa: make eisa_bus_type const
authorAdrian Barnaś <abarnas@google.com>
Fri, 19 Sep 2025 06:53:27 +0000 (06:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Oct 2025 05:55:00 +0000 (07:55 +0200)
Because driver core can properly handle constant struct bus_type,
move the eisa_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/20250919065327.672924-1-abarnas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/eisa/eisa-bus.c
include/linux/eisa.h

index edceea083b98041e43d5425a88763861eb8d42da..bd76d599109ceb713ba462c154a76f3c7af3482e 100644 (file)
@@ -135,7 +135,7 @@ static int eisa_bus_uevent(const struct device *dev, struct kobj_uevent_env *env
        return 0;
 }
 
-struct bus_type eisa_bus_type = {
+const struct bus_type eisa_bus_type = {
        .name  = "eisa",
        .match = eisa_bus_match,
        .uevent = eisa_bus_uevent,
index 21a2ecc1e53895662b68bfecc16be563459f6bdc..cf55630b595b1a9be55ff698844f8fa06d219fb9 100644 (file)
@@ -68,7 +68,7 @@ struct eisa_driver {
 /* These external functions are only available when EISA support is enabled. */
 #ifdef CONFIG_EISA
 
-extern struct bus_type eisa_bus_type;
+extern const struct bus_type eisa_bus_type;
 int eisa_driver_register (struct eisa_driver *edrv);
 void eisa_driver_unregister (struct eisa_driver *edrv);