From: Thomas Weißschuh Date: Fri, 24 Mar 2023 16:27:50 +0000 (+0000) Subject: firmware: turris-mox-rwtm: make kobj_type structure constant X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f326e72a6e0baacea42ecaa9aaa4d7e7a355c972;p=linux.git firmware: turris-mox-rwtm: make kobj_type structure constant Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definition to prevent modification at runtime. Signed-off-by: Thomas Weißschuh Reviewed-by: Marek Behún Signed-off-by: Gregory CLEMENT --- diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index 6ea5789a89e2b..2de0fb139ce17 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -104,7 +104,7 @@ static void mox_kobj_release(struct kobject *kobj) kfree(to_rwtm(kobj)->kobj); } -static struct kobj_type mox_kobj_ktype = { +static const struct kobj_type mox_kobj_ktype = { .release = mox_kobj_release, .sysfs_ops = &kobj_sysfs_ops, };