From: Greg Kroah-Hartman Date: Thu, 8 Jun 2017 08:12:40 +0000 (+0200) Subject: gpio: use class_groups instead of class_attrs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d83bb159f4c6af4a7465ed457d554d30df95e890;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git gpio: 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. Acked-by: Linus Walleij Cc: Alexandre Courbot Cc: Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 4b44dd97c07f..16fe9742597b 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -479,6 +479,7 @@ done: pr_debug("%s: status %d\n", __func__, status); return status ? : len; } +static CLASS_ATTR_WO(export); static ssize_t unexport_store(struct class *class, struct class_attribute *attr, @@ -514,18 +515,20 @@ done: pr_debug("%s: status %d\n", __func__, status); return status ? : len; } +static CLASS_ATTR_WO(unexport); -static struct class_attribute gpio_class_attrs[] = { - __ATTR(export, 0200, NULL, export_store), - __ATTR(unexport, 0200, NULL, unexport_store), - __ATTR_NULL, +static struct attribute *gpio_class_attrs[] = { + &class_attr_export.attr, + &class_attr_unexport.attr, + NULL, }; +ATTRIBUTE_GROUPS(gpio_class); static struct class gpio_class = { .name = "gpio", .owner = THIS_MODULE, - .class_attrs = gpio_class_attrs, + .class_groups = gpio_class_groups, };