From: Kimberly Brown Date: Tue, 2 Apr 2019 02:51:24 +0000 (-0400) Subject: samples/kobject: Replace foo_ktype's default_attrs field with groups X-Git-Tag: v5.2-rc1~154^2~17 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=c484a6783d2b800ebbb110b28b0d96444f8b81ca;p=linux.git 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 Signed-off-by: Greg Kroah-Hartman --- 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[] = { &bar_attribute.attr, 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 @@ -187,7 +188,7 @@ static struct attribute *foo_default_attrs[] = { static struct kobj_type foo_ktype = { .sysfs_ops = &foo_sysfs_ops, .release = foo_release, - .default_attrs = foo_default_attrs, + .default_groups = foo_default_groups, }; static struct kset *example_kset;