Skip to content

Commit

Permalink
PowerCap: Convert class code to use dev_groups
Browse files Browse the repository at this point in the history
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 <treding@nvidia.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Thierry Reding authored and Rafael J. Wysocki committed Oct 25, 2013
1 parent 2d281d8 commit 9e3410b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/powercap/powercap_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 9e3410b

Please sign in to comment.