summaryrefslogtreecommitdiff
path: root/include/linux/configfs.h
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2026-07-16 19:09:30 +0200
committerBreno Leitao <leitao@debian.org>2026-10-16 09:17:20 -0700
commitf7528cd38b87fb59b6e5f96abfd119f0318a52e4 (patch)
treebd3eec8d7e451c925e6f4021fc06128641b18c82 /include/linux/configfs.h
parentee4f267ada12bd5eb8b675018bdd60e60da2c089 (diff)
configfs: Allow the registration of const struct configfs_attribute
The attribute structure defined in driver code never need to be modified. Allow them to be marked as const. As there are many drivers which use these attributes, prepare for a phased transition by using a union of const and non-const attributes. After all drivers have been migrated to the const variant, the non-const one can be replaced by the const one and the transition machinery will be removed again. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Andreas Hindborg <a.hindborg@kernel.org> Link: https://patch.msgid.link/20260716-configfs-const-base-v1-5-c545a4053cb5@weissschuh.net Signed-off-by: Breno Leitao <leitao@debian.org>
Diffstat (limited to 'include/linux/configfs.h')
-rw-r--r--include/linux/configfs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index eff2fb22ab70..5bead9173ec1 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -66,7 +66,10 @@ struct config_item_type {
struct module *ct_owner;
const struct configfs_item_operations *ct_item_ops;
const struct configfs_group_operations *ct_group_ops;
- struct configfs_attribute **ct_attrs;
+ union {
+ struct configfs_attribute **ct_attrs;
+ const struct configfs_attribute *const *ct_attrs_const;
+ };
const struct configfs_bin_attribute *const *ct_bin_attrs;
};