lkml.org 
[lkml]   [2024]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] mei: bus: constify the struct mei_cl_bus_type usage
    Date
    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>
    ---
    drivers/misc/mei/bus.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
    index f9bcff197615..99393f610cdf 100644
    --- a/drivers/misc/mei/bus.c
    +++ b/drivers/misc/mei/bus.c
    @@ -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,
    --
    2.40.1

    \
     
     \ /
      Last update: 2024-05-27 17:57    [W:4.610 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site