Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] PowerCap: Convert class code to use dev_groups

14 views
Skip to first unread message

Thierry Reding

unread,
Oct 23, 2013, 7:50:02 AM10/23/13
to
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 <tre...@nvidia.com>
---
Compile-tested only.
---
drivers/powercap/powercap_sys.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/powercap/powercap_sys.c b/drivers/powercap/powercap_sys.c
index c22fa4c..21814f9 100644
--- a/drivers/powercap/powercap_sys.c
+++ b/drivers/powercap/powercap_sys.c
@@ -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(
--
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Greg Kroah-Hartman

unread,
Oct 23, 2013, 12:10:02 PM10/23/13
to
On Wed, Oct 23, 2013 at 01:37:35PM +0200, Thierry Reding wrote:
> 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 <tre...@nvidia.com>

Acked-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

Rafael J. Wysocki

unread,
Oct 25, 2013, 5:40:02 PM10/25/13
to
On Wednesday, October 23, 2013 04:59:05 PM Greg Kroah-Hartman wrote:
> On Wed, Oct 23, 2013 at 01:37:35PM +0200, Thierry Reding wrote:
> > 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 <tre...@nvidia.com>
>
> Acked-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

Applied, thanks!
0 new messages