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

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 <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: <linux-gpio@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+8 -5
+8 -5
drivers/gpio/gpiolib-sysfs.c
··· 479 479 pr_debug("%s: status %d\n", __func__, status); 480 480 return status ? : len; 481 481 } 482 + static CLASS_ATTR_WO(export); 482 483 483 484 static ssize_t unexport_store(struct class *class, 484 485 struct class_attribute *attr, ··· 515 514 pr_debug("%s: status %d\n", __func__, status); 516 515 return status ? : len; 517 516 } 517 + static CLASS_ATTR_WO(unexport); 518 518 519 - static struct class_attribute gpio_class_attrs[] = { 520 - __ATTR(export, 0200, NULL, export_store), 521 - __ATTR(unexport, 0200, NULL, unexport_store), 522 - __ATTR_NULL, 519 + static struct attribute *gpio_class_attrs[] = { 520 + &class_attr_export.attr, 521 + &class_attr_unexport.attr, 522 + NULL, 523 523 }; 524 + ATTRIBUTE_GROUPS(gpio_class); 524 525 525 526 static struct class gpio_class = { 526 527 .name = "gpio", 527 528 .owner = THIS_MODULE, 528 529 529 - .class_attrs = gpio_class_attrs, 530 + .class_groups = gpio_class_groups, 530 531 }; 531 532 532 533