tee: make tee_bus_type const
authorRicardo B. Marliere <ricardo@marliere.net>
Tue, 13 Feb 2024 14:46:25 +0000 (11:46 -0300)
committerArnd Bergmann <arnd@arndb.de>
Mon, 4 Mar 2024 16:25:09 +0000 (17:25 +0100)
Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the tee_bus_type variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/tee/tee_core.c
include/linux/tee_drv.h

index 792d6fae4354d5a389dbf953e02bb065b1b5fa47..e59c20d74b36ae08db5d372f46ef03b9c4694cb6 100644 (file)
@@ -1226,7 +1226,7 @@ static int tee_client_device_uevent(const struct device *dev,
        return add_uevent_var(env, "MODALIAS=tee:%pUb", dev_id);
 }
 
-struct bus_type tee_bus_type = {
+const struct bus_type tee_bus_type = {
        .name           = "tee",
        .match          = tee_client_device_match,
        .uevent         = tee_client_device_uevent,
index 911ddf92dcee75189535df5231c7fc57bd843cbf..71632e3c5f18fb9d564542c8e6d7984eb54f5151 100644 (file)
@@ -482,7 +482,7 @@ static inline bool tee_param_is_memref(struct tee_param *param)
        }
 }
 
-extern struct bus_type tee_bus_type;
+extern const struct bus_type tee_bus_type;
 
 /**
  * struct tee_client_device - tee based device