[PATCH] gpio: aggregator: constify struct configfs_attribute
From: Bartosz Golaszewski
Date: Wed Oct 21 2026 - 08:35:01 EST
In preparation for the constification of configfs attributes, make the
existing instances of struct configfs_attribute in gpio-aggregator const
and use the new st_attrs_const field of struct config_item_type.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
drivers/gpio/gpio-aggregator.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index b0b65416d74dc13266ff3cb23e1b1f8fac1b892a..be9cc7954238da92cf769bc290265e985c7488a2 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -1147,7 +1147,7 @@ gpio_aggregator_line_offset_store(struct config_item *item, const char *page,
}
CONFIGFS_ATTR(gpio_aggregator_line_, offset);
-static struct configfs_attribute *gpio_aggregator_line_attrs[] = {
+static const struct configfs_attribute *const gpio_aggregator_line_attrs[] = {
&gpio_aggregator_line_attr_key,
&gpio_aggregator_line_attr_name,
&gpio_aggregator_line_attr_offset,
@@ -1222,7 +1222,7 @@ gpio_aggregator_device_live_store(struct config_item *item, const char *page,
}
CONFIGFS_ATTR(gpio_aggregator_device_, live);
-static struct configfs_attribute *gpio_aggregator_device_attrs[] = {
+static const struct configfs_attribute *const gpio_aggregator_device_attrs[] = {
&gpio_aggregator_device_attr_dev_name,
&gpio_aggregator_device_attr_live,
NULL
@@ -1248,7 +1248,7 @@ static const struct configfs_item_operations gpio_aggregator_line_item_ops = {
static const struct config_item_type gpio_aggregator_line_type = {
.ct_item_ops = &gpio_aggregator_line_item_ops,
- .ct_attrs = gpio_aggregator_line_attrs,
+ .ct_attrs_const = gpio_aggregator_line_attrs,
.ct_owner = THIS_MODULE,
};
@@ -1315,7 +1315,7 @@ static const struct configfs_group_operations gpio_aggregator_device_group_ops =
static const struct config_item_type gpio_aggregator_device_type = {
.ct_group_ops = &gpio_aggregator_device_group_ops,
.ct_item_ops = &gpio_aggregator_device_item_ops,
- .ct_attrs = gpio_aggregator_device_attrs,
+ .ct_attrs_const = gpio_aggregator_device_attrs,
.ct_owner = THIS_MODULE,
};
---
base-commit: 8f7df005a7564bd7ffa75da9c3085d5b996f1e16
change-id: 20261021-gpio-aggr-const-configfs-attrs-791fa0afaea3
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>