Skip to content

Commit c484a67

Browse files
kbrown9gregkh
authored andcommitted
samples/kobject: Replace foo_ktype's default_attrs field with groups
The kobj_type default_attrs field is being replaced by the default_groups field. Replace foo_ktype's default_attrs field with default_groups and use the ATTRIBUTE_GROUPS macro to create foo_default_groups. This patch was tested by loading the kset-example module and verifying that the sysfs files for the attributes in the default group were created. Signed-off-by: Kimberly Brown <kimbrownkd@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent aa30f47 commit c484a67

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎samples/kobject/kset-example.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static struct attribute *foo_default_attrs[] = {
178178
&bar_attribute.attr,
179179
NULL, /* need to NULL terminate the list of attributes */
180180
};
181+
ATTRIBUTE_GROUPS(foo_default);
181182

182183
/*
183184
* Our own ktype for our kobjects. Here we specify our sysfs ops, the
@@ -187,7 +188,7 @@ static struct attribute *foo_default_attrs[] = {
187188
static struct kobj_type foo_ktype = {
188189
.sysfs_ops = &foo_sysfs_ops,
189190
.release = foo_release,
190-
.default_attrs = foo_default_attrs,
191+
.default_groups = foo_default_groups,
191192
};
192193

193194
static struct kset *example_kset;

0 commit comments

Comments
 (0)