提交 9e3410b7 编写于 作者: T Thierry Reding 提交者: Rafael J. Wysocki

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: NThierry Reding <treding@nvidia.com>
Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 2d281d81
...@@ -472,16 +472,18 @@ static ssize_t enabled_store(struct device *dev, ...@@ -472,16 +472,18 @@ static ssize_t enabled_store(struct device *dev,
return -ENOSYS; return -ENOSYS;
} }
static struct device_attribute powercap_def_attrs[] = { static DEVICE_ATTR_RW(enabled);
__ATTR(enabled, S_IWUSR | S_IRUGO, enabled_show,
enabled_store), static struct attribute *powercap_attrs[] = {
__ATTR_NULL &dev_attr_enabled.attr,
NULL,
}; };
ATTRIBUTE_GROUPS(powercap);
static struct class powercap_class = { static struct class powercap_class = {
.name = "powercap", .name = "powercap",
.dev_release = powercap_release, .dev_release = powercap_release,
.dev_attrs = powercap_def_attrs, .dev_groups = powercap_groups,
}; };
struct powercap_zone *powercap_register_zone( struct powercap_zone *powercap_register_zone(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册