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

ACPI: sysfs: use default_groups in kobj_type

There are currently 2 ways to create a set of sysfs files for a
kobj_type, through the default_attrs field, and the default_groups
field. Move the ACPI sysfs code to use default_groups field which has
been the preferred way since aa30f47cf666 ("kobject: Add support for
default attribute groups to kobj_type") so that we can soon get rid of
the obsolete default_attrs field.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Greg Kroah-Hartman and committed by
Rafael J. Wysocki
17f18417 fc74e0a4

+6 -3
+2 -1
drivers/acpi/cppc_acpi.c
··· 179 179 &lowest_freq.attr, 180 180 NULL 181 181 }; 182 + ATTRIBUTE_GROUPS(cppc); 182 183 183 184 static struct kobj_type cppc_ktype = { 184 185 .sysfs_ops = &kobj_sysfs_ops, 185 - .default_attrs = cppc_attrs, 186 + .default_groups = cppc_groups, 186 187 }; 187 188 188 189 static int check_pcc_chan(int pcc_ss_id, bool chk_err_bit)
+2 -1
drivers/acpi/device_sysfs.c
··· 53 53 &data_node_path.attr, 54 54 NULL 55 55 }; 56 + ATTRIBUTE_GROUPS(acpi_data_node_default); 56 57 57 58 #define to_data_node(k) container_of(k, struct acpi_data_node, kobj) 58 59 #define to_attr(a) container_of(a, struct acpi_data_node_attr, attr) ··· 80 79 81 80 static struct kobj_type acpi_data_node_ktype = { 82 81 .sysfs_ops = &acpi_data_node_sysfs_ops, 83 - .default_attrs = acpi_data_node_default_attrs, 82 + .default_groups = acpi_data_node_default_groups, 84 83 .release = acpi_data_node_release, 85 84 }; 86 85
+2 -1
drivers/acpi/sysfs.c
··· 939 939 &hotplug_enabled_attr.attr, 940 940 NULL 941 941 }; 942 + ATTRIBUTE_GROUPS(hotplug_profile); 942 943 943 944 static struct kobj_type acpi_hotplug_profile_ktype = { 944 945 .sysfs_ops = &kobj_sysfs_ops, 945 - .default_attrs = hotplug_profile_attrs, 946 + .default_groups = hotplug_profile_groups, 946 947 }; 947 948 948 949 void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,