* [PATCH] ACPI: sysfs: use default_groups in kobj_type
@ 2021-12-28 13:14 Greg Kroah-Hartman
2021-12-28 18:16 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2021-12-28 13:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Len Brown, linux-acpi
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.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/cppc_acpi.c | 3 ++-
drivers/acpi/device_sysfs.c | 3 ++-
drivers/acpi/sysfs.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index a85c351589be..d251b2a1cd15 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -179,10 +179,11 @@ static struct attribute *cppc_attrs[] = {
&lowest_freq.attr,
NULL
};
+ATTRIBUTE_GROUPS(cppc);
static struct kobj_type cppc_ktype = {
.sysfs_ops = &kobj_sysfs_ops,
- .default_attrs = cppc_attrs,
+ .default_groups = cppc_groups,
};
static int check_pcc_chan(int pcc_ss_id, bool chk_err_bit)
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
index 61271e61c307..d5d6403ba07b 100644
--- a/drivers/acpi/device_sysfs.c
+++ b/drivers/acpi/device_sysfs.c
@@ -53,6 +53,7 @@ static struct attribute *acpi_data_node_default_attrs[] = {
&data_node_path.attr,
NULL
};
+ATTRIBUTE_GROUPS(acpi_data_node_default);
#define to_data_node(k) container_of(k, struct acpi_data_node, kobj)
#define to_attr(a) container_of(a, struct acpi_data_node_attr, attr)
@@ -79,7 +80,7 @@ static void acpi_data_node_release(struct kobject *kobj)
static struct kobj_type acpi_data_node_ktype = {
.sysfs_ops = &acpi_data_node_sysfs_ops,
- .default_attrs = acpi_data_node_default_attrs,
+ .default_groups = acpi_data_node_default_groups,
.release = acpi_data_node_release,
};
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index 00c0ebaab29f..a4b638bea6f1 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -939,10 +939,11 @@ static struct attribute *hotplug_profile_attrs[] = {
&hotplug_enabled_attr.attr,
NULL
};
+ATTRIBUTE_GROUPS(hotplug_profile);
static struct kobj_type acpi_hotplug_profile_ktype = {
.sysfs_ops = &kobj_sysfs_ops,
- .default_attrs = hotplug_profile_attrs,
+ .default_groups = hotplug_profile_groups,
};
void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: sysfs: use default_groups in kobj_type
2021-12-28 13:14 [PATCH] ACPI: sysfs: use default_groups in kobj_type Greg Kroah-Hartman
@ 2021-12-28 18:16 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2021-12-28 18:16 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Linux Kernel Mailing List, Rafael J. Wysocki, Len Brown,
ACPI Devel Maling List
On Tue, Dec 28, 2021 at 2:14 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> 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.
>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Len Brown <lenb@kernel.org>
> Cc: linux-acpi@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Applied as 5.17 material, thanks!
> ---
> drivers/acpi/cppc_acpi.c | 3 ++-
> drivers/acpi/device_sysfs.c | 3 ++-
> drivers/acpi/sysfs.c | 3 ++-
> 3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index a85c351589be..d251b2a1cd15 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -179,10 +179,11 @@ static struct attribute *cppc_attrs[] = {
> &lowest_freq.attr,
> NULL
> };
> +ATTRIBUTE_GROUPS(cppc);
>
> static struct kobj_type cppc_ktype = {
> .sysfs_ops = &kobj_sysfs_ops,
> - .default_attrs = cppc_attrs,
> + .default_groups = cppc_groups,
> };
>
> static int check_pcc_chan(int pcc_ss_id, bool chk_err_bit)
> diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c
> index 61271e61c307..d5d6403ba07b 100644
> --- a/drivers/acpi/device_sysfs.c
> +++ b/drivers/acpi/device_sysfs.c
> @@ -53,6 +53,7 @@ static struct attribute *acpi_data_node_default_attrs[] = {
> &data_node_path.attr,
> NULL
> };
> +ATTRIBUTE_GROUPS(acpi_data_node_default);
>
> #define to_data_node(k) container_of(k, struct acpi_data_node, kobj)
> #define to_attr(a) container_of(a, struct acpi_data_node_attr, attr)
> @@ -79,7 +80,7 @@ static void acpi_data_node_release(struct kobject *kobj)
>
> static struct kobj_type acpi_data_node_ktype = {
> .sysfs_ops = &acpi_data_node_sysfs_ops,
> - .default_attrs = acpi_data_node_default_attrs,
> + .default_groups = acpi_data_node_default_groups,
> .release = acpi_data_node_release,
> };
>
> diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
> index 00c0ebaab29f..a4b638bea6f1 100644
> --- a/drivers/acpi/sysfs.c
> +++ b/drivers/acpi/sysfs.c
> @@ -939,10 +939,11 @@ static struct attribute *hotplug_profile_attrs[] = {
> &hotplug_enabled_attr.attr,
> NULL
> };
> +ATTRIBUTE_GROUPS(hotplug_profile);
>
> static struct kobj_type acpi_hotplug_profile_ktype = {
> .sysfs_ops = &kobj_sysfs_ops,
> - .default_attrs = hotplug_profile_attrs,
> + .default_groups = hotplug_profile_groups,
> };
>
> void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug,
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-28 18:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28 13:14 [PATCH] ACPI: sysfs: use default_groups in kobj_type Greg Kroah-Hartman
2021-12-28 18:16 ` Rafael J. Wysocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.