diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2023-02-16 01:05:30 +0000 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2023-02-17 11:50:28 +0200 |
commit | 01361096a33a81cc224e12e8cf06240f12737365 (patch) | |
tree | e60d04f368b2a2b90fdb878d6e179fcd3a147a81 /drivers | |
parent | d6683bbe70d4cdbf3da6acecf7d569cc6f0b4382 (diff) | |
download | linux-stable-01361096a33a81cc224e12e8cf06240f12737365.tar.gz linux-stable-01361096a33a81cc224e12e8cf06240f12737365.tar.bz2 linux-stable-01361096a33a81cc224e12e8cf06240f12737365.zip |
drm/i915: Make kobj_type structures 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 definitions to prevent
modification at runtime.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230216-kobj_type-i915-v1-1-ca65c9b93518@weissschuh.net
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/gt/intel_gt_sysfs.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/gt/sysfs_engines.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_sysfs.c b/drivers/gpu/drm/i915/gt/intel_gt_sysfs.c index 6629e4c72b6b..33cba406b569 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_sysfs.c +++ b/drivers/gpu/drm/i915/gt/intel_gt_sysfs.c @@ -72,7 +72,7 @@ static void kobj_gt_release(struct kobject *kobj) { } -static struct kobj_type kobj_gt_type = { +static const struct kobj_type kobj_gt_type = { .release = kobj_gt_release, .sysfs_ops = &kobj_sysfs_ops, .default_groups = id_groups, diff --git a/drivers/gpu/drm/i915/gt/sysfs_engines.c b/drivers/gpu/drm/i915/gt/sysfs_engines.c index 323cead181b8..7eae3265f8cd 100644 --- a/drivers/gpu/drm/i915/gt/sysfs_engines.c +++ b/drivers/gpu/drm/i915/gt/sysfs_engines.c @@ -419,7 +419,7 @@ static void kobj_engine_release(struct kobject *kobj) kfree(kobj); } -static struct kobj_type kobj_engine_type = { +static const struct kobj_type kobj_engine_type = { .release = kobj_engine_release, .sysfs_ops = &kobj_sysfs_ops }; |