linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PowerCap: Convert class code to use dev_groups
@ 2013-10-23 11:37 Thierry Reding
  2013-10-23 15:59 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2013-10-23 11:37 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Jacob Pan, Greg Kroah-Hartman, linux-next, linux-kernel

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>
---
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PowerCap: Convert class code to use dev_groups
  2013-10-23 11:37 [PATCH] PowerCap: Convert class code to use dev_groups Thierry Reding
@ 2013-10-23 15:59 ` Greg Kroah-Hartman
  2013-10-25 21:42   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2013-10-23 15:59 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Rafael J. Wysocki, Jacob Pan, linux-next, linux-kernel

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 <treding@nvidia.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PowerCap: Convert class code to use dev_groups
  2013-10-23 15:59 ` Greg Kroah-Hartman
@ 2013-10-25 21:42   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2013-10-25 21:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Thierry Reding; +Cc: Jacob Pan, linux-next, linux-kernel

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 <treding@nvidia.com>
> 
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-25 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23 11:37 [PATCH] PowerCap: Convert class code to use dev_groups Thierry Reding
2013-10-23 15:59 ` Greg Kroah-Hartman
2013-10-25 21:42   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).