Skip to contentSkip to conversation

patch "mtd: use class_groups instead of class_attrs" added to driver-core-next

PATCH [email protected] 1 participant 1 message Jun 9, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mtd: use class_groups instead of class_attrs

to my driver-core git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
in the driver-core-next branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will also be merged in the next major kernel release during the merge window.

If you have any questions about this process, please let me know.

Quoted 1 line

From 219eccdabb3a877d285b35b59cfeb242381f9d50 Mon Sep 17 00:00:00 2001

From: Greg Kroah-Hartman <[email protected]>
Date: Thu, 8 Jun 2017 10:12:38 +0200
Subject: mtd: use class_groups instead of class_attrs

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 <[email protected]>
Cc David Woodhouse <[email protected]>
Cc Brian Norris <[email protected]>
Cc Boris Brezillon <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Cyrille Pitchen <[email protected]>
---
 drivers/mtd/ubi/build.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/mtd/ubi/build.c +9 -7
index 93e5d251a9e4..d854521962ef 100644
@@ -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,
Signature · 1 line
2.13.1