tifm: constify the struct tifm_bus_type usage
authorKunwu Chan <chentao@kylinos.cn>
Tue, 23 Apr 2024 02:38:10 +0000 (10:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 May 2024 16:59:58 +0000 (18:59 +0200)
Now that the driver core can properly handle constant struct bus_type,
move the tifm_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>
Link: https://lore.kernel.org/r/20240423023810.1889264-1-chentao@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/tifm_core.c

index d2eb31f39aa7d00d397469fbcdfe051660310193..fd9c3cbbc51ed272af2620fb11fdd411d9ddc845 100644 (file)
@@ -148,7 +148,7 @@ static struct attribute *tifm_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(tifm_dev);
 
-static struct bus_type tifm_bus_type = {
+static const struct bus_type tifm_bus_type = {
        .name      = "tifm",
        .dev_groups = tifm_dev_groups,
        .match     = tifm_bus_match,