aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorKimberly Brown <kimbrownkd@gmail.com>2019-04-01 22:51:24 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-25 16:06:10 -0400
commitc484a6783d2b800ebbb110b28b0d96444f8b81ca (patch)
tree004b13a50d58fc29aaa7c9b8ff2e098c94c2809d /samples
parentaa30f47cf666111f6bbfd15f290a27e8a7b9d854 (diff)
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>
Diffstat (limited to 'samples')
-rw-r--r--samples/kobject/kset-example.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index 401328fd687d..c8010f126808 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -178,6 +178,7 @@ static struct attribute *foo_default_attrs[] = {
178 &bar_attribute.attr, 178 &bar_attribute.attr,
179 NULL, /* need to NULL terminate the list of attributes */ 179 NULL, /* need to NULL terminate the list of attributes */
180}; 180};
181ATTRIBUTE_GROUPS(foo_default);
181 182
182/* 183/*
183 * Our own ktype for our kobjects. Here we specify our sysfs ops, the 184 * Our own ktype for our kobjects. Here we specify our sysfs ops, the
@@ -187,7 +188,7 @@ static struct attribute *foo_default_attrs[] = {
187static struct kobj_type foo_ktype = { 188static struct kobj_type foo_ktype = {
188 .sysfs_ops = &foo_sysfs_ops, 189 .sysfs_ops = &foo_sysfs_ops,
189 .release = foo_release, 190 .release = foo_release,
190 .default_attrs = foo_default_attrs, 191 .default_groups = foo_default_groups,
191}; 192};
192 193
193static struct kset *example_kset; 194static struct kset *example_kset;