mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
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>
This commit is contained in:
parent
f62014fcb9
commit
219eccdabb
1 changed files with 9 additions and 7 deletions
|
@ -104,23 +104,25 @@ DEFINE_MUTEX(ubi_devices_mutex);
|
||||||
static DEFINE_SPINLOCK(ubi_devices_lock);
|
static DEFINE_SPINLOCK(ubi_devices_lock);
|
||||||
|
|
||||||
/* "Show" method for files in '/<sysfs>/class/ubi/' */
|
/* "Show" method for files in '/<sysfs>/class/ubi/' */
|
||||||
static ssize_t ubi_version_show(struct class *class,
|
/* UBI version attribute ('/<sysfs>/class/ubi/version') */
|
||||||
struct class_attribute *attr, char *buf)
|
static ssize_t version_show(struct class *class, struct class_attribute *attr,
|
||||||
|
char *buf)
|
||||||
{
|
{
|
||||||
return sprintf(buf, "%d\n", UBI_VERSION);
|
return sprintf(buf, "%d\n", UBI_VERSION);
|
||||||
}
|
}
|
||||||
|
static CLASS_ATTR_RO(version);
|
||||||
|
|
||||||
/* UBI version attribute ('/<sysfs>/class/ubi/version') */
|
static struct attribute *ubi_class_attrs[] = {
|
||||||
static struct class_attribute ubi_class_attrs[] = {
|
&class_attr_version.attr,
|
||||||
__ATTR(version, S_IRUGO, ubi_version_show, NULL),
|
NULL,
|
||||||
__ATTR_NULL
|
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(ubi_class);
|
||||||
|
|
||||||
/* Root UBI "class" object (corresponds to '/<sysfs>/class/ubi/') */
|
/* Root UBI "class" object (corresponds to '/<sysfs>/class/ubi/') */
|
||||||
struct class ubi_class = {
|
struct class ubi_class = {
|
||||||
.name = UBI_NAME_STR,
|
.name = UBI_NAME_STR,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.class_attrs = ubi_class_attrs,
|
.class_groups = ubi_class_groups,
|
||||||
};
|
};
|
||||||
|
|
||||||
static ssize_t dev_attribute_show(struct device *dev,
|
static ssize_t dev_attribute_show(struct device *dev,
|
||||||
|
|
Loading…
Reference in a new issue