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

tifm: constify the struct tifm_bus_type usage

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>

authored by

Kunwu Chan and committed by
Greg Kroah-Hartman
bd860309 42316941

+1 -1
+1 -1
drivers/misc/tifm_core.c
··· 148 148 }; 149 149 ATTRIBUTE_GROUPS(tifm_dev); 150 150 151 - static struct bus_type tifm_bus_type = { 151 + static const struct bus_type tifm_bus_type = { 152 152 .name = "tifm", 153 153 .dev_groups = tifm_dev_groups, 154 154 .match = tifm_bus_match,