PowerCap: Convert class code to use dev_groups
Subsystems (2)
PATCH 1/1 PowerCap: Convert class code to use dev_groups
The newly added power capping framework uses the obsolete .dev_attrs field of struct class. However this field will be removed in 3.13, so convert the code to use the .dev_groups field instead.
Signed-off-by Thierry Reding <[email protected]>
---
Compile-tested only.
--- drivers/powercap/powercap_sys.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/powercap/powercap_sys.c +7 -5
@@ -472,16 +472,18 @@ static ssize_t enabled_store(struct device *dev,return -ENOSYS ; } -static struct device_attribute powercap_def_attrs[] = { -__ATTR (enabled,S_IWUSR |S_IRUGO , enabled_show, - enabled_store), - __ATTR_NULL +static DEVICE_ATTR_RW (enabled); + +static struct attribute *powercap_attrs[] = { + &dev_attr_enabled.attr, +NULL , }; +ATTRIBUTE_GROUPS (powercap);static struct class powercap_class = { .name ="powercap" , .dev_release = powercap_release, - .dev_attrs = powercap_def_attrs, + .dev_groups = powercap_groups, }; struct powercap_zone *powercap_register_zone(
Signature · 1 line
1.8.4
Quoted 5 lines · Thierry Reding
The newly added power capping framework uses the obsolete .dev_attrs field of struct class. However this field will be removed in 3.13, so convert the code to use the .dev_groups field instead.
Signed-off-by Thierry Reding <[email protected]>
Rafael J. Wysocki
AppliedQuoted 8 lines · Greg Kroah-Hartman
Quoted 5 lines · Thierry Reding
The newly added power capping framework uses the obsolete .dev_attrs field of struct class. However this field will be removed in 3.13, so convert the code to use the .dev_groups field instead.
Signed-off-by Thierry Reding <[email protected]>
Applied, thanks!