Commit c484a678 authored by Kimberly Brown's avatar Kimberly Brown Committed by Greg Kroah-Hartman

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: default avatarKimberly Brown <kimbrownkd@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aa30f47c
...@@ -178,6 +178,7 @@ static struct attribute *foo_default_attrs[] = { ...@@ -178,6 +178,7 @@ static struct attribute *foo_default_attrs[] = {
&bar_attribute.attr, &bar_attribute.attr,
NULL, /* need to NULL terminate the list of attributes */ NULL, /* need to NULL terminate the list of attributes */
}; };
ATTRIBUTE_GROUPS(foo_default);
/* /*
* Our own ktype for our kobjects. Here we specify our sysfs ops, the * Our own ktype for our kobjects. Here we specify our sysfs ops, the
...@@ -187,7 +188,7 @@ static struct attribute *foo_default_attrs[] = { ...@@ -187,7 +188,7 @@ static struct attribute *foo_default_attrs[] = {
static struct kobj_type foo_ktype = { static struct kobj_type foo_ktype = {
.sysfs_ops = &foo_sysfs_ops, .sysfs_ops = &foo_sysfs_ops,
.release = foo_release, .release = foo_release,
.default_attrs = foo_default_attrs, .default_groups = foo_default_groups,
}; };
static struct kset *example_kset; static struct kset *example_kset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment