]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PowerCap: Convert class code to use dev_groups
authorThierry Reding <treding@nvidia.com>
Tue, 22 Oct 2013 14:55:38 +0000 (16:55 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 24 Oct 2013 13:03:00 +0000 (15:03 +0200)
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>
drivers/powercap/powercap_sys.c

index c22fa4c78eaa095d5c8ce9de9835b59cb1f4f07d..21814f90a44bff866d2304dd2054c3eb9c1452ba 100644 (file)
@@ -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(