[PATCH 3/3] md: use ATTRIBUTE_GROUPS() for md default sysfs attributes
From: Abd-Alrhman Masalkhi
Date: Thu Apr 23 2026 - 06:19:42 EST
Replace the md_default_group and md_attr_groups with
ATTRIBUTE_GROUPS().
Signed-off-by: Abd-Alrhman Masalkhi <abd.masalkhi@xxxxxxxxx>
---
drivers/md/md.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 346d071c1b8e..0e55639211f2 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6045,10 +6045,7 @@ static struct attribute *md_default_attrs[] = {
&md_logical_block_size.attr,
NULL,
};
-
-static const struct attribute_group md_default_group = {
- .attrs = md_default_attrs,
-};
+ATTRIBUTE_GROUPS(md_default);
static struct attribute *md_redundancy_attrs[] = {
&md_scan_mode.attr,
@@ -6073,11 +6070,6 @@ static const struct attribute_group md_redundancy_group = {
.attrs = md_redundancy_attrs,
};
-static const struct attribute_group *md_attr_groups[] = {
- &md_default_group,
- NULL,
-};
-
static ssize_t
md_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
{
@@ -6154,7 +6146,7 @@ static const struct sysfs_ops md_sysfs_ops = {
static const struct kobj_type md_ktype = {
.release = md_kobj_release,
.sysfs_ops = &md_sysfs_ops,
- .default_groups = md_attr_groups,
+ .default_groups = md_default_groups,
};
int mdp_major = 0;
--
2.43.0