Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <dedekind1@gmail.com>
Acked-by: 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>

+9 -7
+9 -7
drivers/mtd/ubi/build.c
··· 104 104 static DEFINE_SPINLOCK(ubi_devices_lock); 105 105 106 106 /* "Show" method for files in '/<sysfs>/class/ubi/' */ 107 - static ssize_t ubi_version_show(struct class *class, 108 - struct class_attribute *attr, char *buf) 107 + /* UBI version attribute ('/<sysfs>/class/ubi/version') */ 108 + static ssize_t version_show(struct class *class, struct class_attribute *attr, 109 + char *buf) 109 110 { 110 111 return sprintf(buf, "%d\n", UBI_VERSION); 111 112 } 113 + static CLASS_ATTR_RO(version); 112 114 113 - /* UBI version attribute ('/<sysfs>/class/ubi/version') */ 114 - static struct class_attribute ubi_class_attrs[] = { 115 - __ATTR(version, S_IRUGO, ubi_version_show, NULL), 116 - __ATTR_NULL 115 + static struct attribute *ubi_class_attrs[] = { 116 + &class_attr_version.attr, 117 + NULL, 117 118 }; 119 + ATTRIBUTE_GROUPS(ubi_class); 118 120 119 121 /* Root UBI "class" object (corresponds to '/<sysfs>/class/ubi/') */ 120 122 struct class ubi_class = { 121 123 .name = UBI_NAME_STR, 122 124 .owner = THIS_MODULE, 123 - .class_attrs = ubi_class_attrs, 125 + .class_groups = ubi_class_groups, 124 126 }; 125 127 126 128 static ssize_t dev_attribute_show(struct device *dev,