public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 3/7] mtd: use class_groups instead of class_attrs
       [not found] <20170608081242.27061-1-gregkh@linuxfoundation.org>
@ 2017-06-08  8:12 ` Greg Kroah-Hartman
  2017-06-08 10:23   ` Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-08  8:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Artem Bityutskiy, Richard Weinberger,
	David Woodhouse, Brian Norris, Boris Brezillon, Marek Vasut,
	Cyrille Pitchen, linux-mtd

The class_attrs pointer is long depreciated, and is about to be finally
removed, so move to use the class_groups pointer instead.

Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Cc: <linux-mtd@lists.infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/mtd/ubi/build.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 93e5d251a9e4..d854521962ef 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -104,23 +104,25 @@ DEFINE_MUTEX(ubi_devices_mutex);
 static DEFINE_SPINLOCK(ubi_devices_lock);
 
 /* "Show" method for files in '/<sysfs>/class/ubi/' */
-static ssize_t ubi_version_show(struct class *class,
-				struct class_attribute *attr, char *buf)
+/* UBI version attribute ('/<sysfs>/class/ubi/version') */
+static ssize_t version_show(struct class *class, struct class_attribute *attr,
+			    char *buf)
 {
 	return sprintf(buf, "%d\n", UBI_VERSION);
 }
+static CLASS_ATTR_RO(version);
 
-/* UBI version attribute ('/<sysfs>/class/ubi/version') */
-static struct class_attribute ubi_class_attrs[] = {
-	__ATTR(version, S_IRUGO, ubi_version_show, NULL),
-	__ATTR_NULL
+static struct attribute *ubi_class_attrs[] = {
+	&class_attr_version.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(ubi_class);
 
 /* Root UBI "class" object (corresponds to '/<sysfs>/class/ubi/') */
 struct class ubi_class = {
 	.name		= UBI_NAME_STR,
 	.owner		= THIS_MODULE,
-	.class_attrs	= ubi_class_attrs,
+	.class_groups	= ubi_class_groups,
 };
 
 static ssize_t dev_attribute_show(struct device *dev,
-- 
2.13.1

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

* Re: [PATCH 3/7] mtd: use class_groups instead of class_attrs
  2017-06-08  8:12 ` [PATCH 3/7] mtd: use class_groups instead of class_attrs Greg Kroah-Hartman
@ 2017-06-08 10:23   ` Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2017-06-08 10:23 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel
  Cc: Artem Bityutskiy, David Woodhouse, Brian Norris, Boris Brezillon,
	Marek Vasut, Cyrille Pitchen, linux-mtd

Am 08.06.2017 um 10:12 schrieb Greg Kroah-Hartman:
> The class_attrs pointer is long depreciated, and is about to be finally
> removed, so move to use the class_groups pointer instead.
> 
> Cc: Artem Bityutskiy <dedekind1@gmail.com>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Brian Norris <computersforpeace@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
> Cc: <linux-mtd@lists.infradead.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Acked-by: Richard Weinberger <richard@nod.at>

Thanks,
//richard

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

end of thread, other threads:[~2017-06-08 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170608081242.27061-1-gregkh@linuxfoundation.org>
2017-06-08  8:12 ` [PATCH 3/7] mtd: use class_groups instead of class_attrs Greg Kroah-Hartman
2017-06-08 10:23   ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox