[PATCH] tifm: constify the struct tifm_bus_type usage

Kunwu Chan posted 1 patch 1 year, 9 months ago
drivers/misc/tifm_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tifm: constify the struct tifm_bus_type usage
Posted by Kunwu Chan 1 year, 9 months ago
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>
---
 drivers/misc/tifm_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c
index d2eb31f39aa7..fd9c3cbbc51e 100644
--- a/drivers/misc/tifm_core.c
+++ b/drivers/misc/tifm_core.c
@@ -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,
-- 
2.40.1