mei: bus: constify the struct mei_cl_bus_type usage
authorKunwu Chan <chentao@kylinos.cn>
Tue, 23 Apr 2024 02:41:33 +0000 (10:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Apr 2024 04:33:16 +0000 (21:33 -0700)
Now that the driver core can properly handle constant struct bus_type,
move the mei_cl_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20240423024133.1890455-1-chentao@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/bus.c

index f9bcff197615128d72f17590c3e058fbeaa904bd..99393f610cdf6dda8ca00326f110f61e4eba4aa6 100644 (file)
@@ -1327,7 +1327,7 @@ static int mei_cl_device_uevent(const struct device *dev, struct kobj_uevent_env
        return 0;
 }
 
-static struct bus_type mei_cl_bus_type = {
+static const struct bus_type mei_cl_bus_type = {
        .name           = "mei",
        .dev_groups     = mei_cldev_groups,
        .match          = mei_cl_device_match,