Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1531400 > unrolled thread

[PATCH 2/3] driver core: devcoredump: convert to use class_groups

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-11-28 16:50 +0100
Last post2016-11-29 19:10 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] driver core: devcoredump: convert to use class_groups Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-28 16:50 +0100
    Re: [PATCH 2/3] driver core: devcoredump: convert to use  class_groups Johannes Berg <johannes@sipsolutions.net> - 2016-11-28 16:50 +0100
    [PATCH 3/3] driver core: firmware_class: convert to use class_groups Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-11-28 16:50 +0100
      Re: [PATCH 3/3] driver core: firmware_class: convert to use  class_groups "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-11-29 19:10 +0100

#1531400 — [PATCH 2/3] driver core: devcoredump: convert to use class_groups

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-11-28 16:50 +0100
Subject[PATCH 2/3] driver core: devcoredump: convert to use class_groups
Message-ID<sIwlP-3V2-1@gated-at.bofh.it>
Convert devcoredump to use class_groups instead of class_attrs as that's
the correct way to handle lists of class attribute files.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/devcoredump.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c
index 240374fd1838..7be310f7db73 100644
--- a/drivers/base/devcoredump.c
+++ b/drivers/base/devcoredump.c
@@ -160,18 +160,20 @@ static ssize_t disabled_store(struct class *class, struct class_attribute *attr,
 
 	return count;
 }
+static CLASS_ATTR_RW(disabled);
 
-static struct class_attribute devcd_class_attrs[] = {
-	__ATTR_RW(disabled),
-	__ATTR_NULL
+static struct attribute *devcd_class_attrs[] = {
+	&class_attr_disabled.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(devcd_class);
 
 static struct class devcd_class = {
 	.name		= "devcoredump",
 	.owner		= THIS_MODULE,
 	.dev_release	= devcd_dev_release,
 	.dev_groups	= devcd_dev_groups,
-	.class_attrs	= devcd_class_attrs,
+	.class_groups	= devcd_class_groups,
 };
 
 static ssize_t devcd_readv(char *buffer, loff_t offset, size_t count,
-- 
2.10.2

[toc] | [next] | [standalone]


#1531402 — Re: [PATCH 2/3] driver core: devcoredump: convert to use class_groups

FromJohannes Berg <johannes@sipsolutions.net>
Date2016-11-28 16:50 +0100
SubjectRe: [PATCH 2/3] driver core: devcoredump: convert to use class_groups
Message-ID<sIwlP-3V2-13@gated-at.bofh.it>
In reply to#1531400
On Mon, 2016-11-28 at 16:41 +0100, Greg Kroah-Hartman wrote:
> Convert devcoredump to use class_groups instead of class_attrs as
> that's
> the correct way to handle lists of class attribute files.

Fine with me, of course

Acked-by: Johannes Berg <johannes@sipsolutions.net>

johannes

[toc] | [prev] | [next] | [standalone]


#1531403 — [PATCH 3/3] driver core: firmware_class: convert to use class_groups

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-11-28 16:50 +0100
Subject[PATCH 3/3] driver core: firmware_class: convert to use class_groups
Message-ID<sIwlQ-3V2-19@gated-at.bofh.it>
In reply to#1531400
Convert the firmware core to use class_groups instead of class_attrs as
that's the correct way to handle lists of class attribute files.

Cc: Ming Lei <ming.lei@canonical.com>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/firmware_class.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 22d1760a4278..98c4f28ad2a1 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -546,11 +546,13 @@ static ssize_t timeout_store(struct class *class, struct class_attribute *attr,
 
 	return count;
 }
+static CLASS_ATTR_RW(timeout);
 
-static struct class_attribute firmware_class_attrs[] = {
-	__ATTR_RW(timeout),
-	__ATTR_NULL
+static struct attribute *firmware_class_attrs[] = {
+	&class_attr_timeout.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(firmware_class);
 
 static void fw_dev_release(struct device *dev)
 {
@@ -585,7 +587,7 @@ static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 static struct class firmware_class = {
 	.name		= "firmware",
-	.class_attrs	= firmware_class_attrs,
+	.class_groups	= firmware_class_groups,
 	.dev_uevent	= firmware_uevent,
 	.dev_release	= fw_dev_release,
 };
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1532627 — Re: [PATCH 3/3] driver core: firmware_class: convert to use class_groups

From"Luis R. Rodriguez" <mcgrof@kernel.org>
Date2016-11-29 19:10 +0100
SubjectRe: [PATCH 3/3] driver core: firmware_class: convert to use class_groups
Message-ID<sIV0S-3tJ-27@gated-at.bofh.it>
In reply to#1531403
On Mon, Nov 28, 2016 at 04:42:30PM +0100, Greg Kroah-Hartman wrote:
> Convert the firmware core to use class_groups instead of class_attrs as
> that's the correct way to handle lists of class attribute files.
> 
> Cc: Ming Lei <ming.lei@canonical.com>
> Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>

  Luis

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web