Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kimberly Brown and committed by
Greg Kroah-Hartman
c484a678 aa30f47c

+2 -1
+2 -1
samples/kobject/kset-example.c
··· 178 178 &bar_attribute.attr, 179 179 NULL, /* need to NULL terminate the list of attributes */ 180 180 }; 181 + ATTRIBUTE_GROUPS(foo_default); 181 182 182 183 /* 183 184 * Our own ktype for our kobjects. Here we specify our sysfs ops, the ··· 188 187 static struct kobj_type foo_ktype = { 189 188 .sysfs_ops = &foo_sysfs_ops, 190 189 .release = foo_release, 191 - .default_attrs = foo_default_attrs, 190 + .default_groups = foo_default_groups, 192 191 }; 193 192 194 193 static struct kset *example_kset;