aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2010-01-05 06:48:07 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-07 20:04:48 -0500
commit28812fe11a21826ba4c97c6c7971a619987cd912 (patch)
treec78daefd595989bbc660ea48d8bc2dc5750321d3 /drivers/gpio/gpiolib.c
parent5fbcae57db69128c14080a7a5a42d0626bfe155c (diff)
driver-core: Add attribute argument to class_attribute show/store
Passing the attribute to the low level IO functions allows all kinds of cleanups, by sharing low level IO code without requiring an own function for every piece of data. Also drivers can extend the attributes with own data fields and use that in the low level function. This makes the class attributes the same as sysdev_class attributes and plain attributes. This will allow further cleanups in drivers. Full tree sweep converting all users. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 9006fdb26fe..6d1b86661e6 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -623,7 +623,9 @@ static const struct attribute_group gpiochip_attr_group = {
623 * /sys/class/gpio/unexport ... write-only 623 * /sys/class/gpio/unexport ... write-only
624 * integer N ... number of GPIO to unexport 624 * integer N ... number of GPIO to unexport
625 */ 625 */
626static ssize_t export_store(struct class *class, const char *buf, size_t len) 626static ssize_t export_store(struct class *class,
627 struct class_attribute *attr,
628 const char *buf, size_t len)
627{ 629{
628 long gpio; 630 long gpio;
629 int status; 631 int status;
@@ -653,7 +655,9 @@ done:
653 return status ? : len; 655 return status ? : len;
654} 656}
655 657
656static ssize_t unexport_store(struct class *class, const char *buf, size_t len) 658static ssize_t unexport_store(struct class *class,
659 struct class_attribute *attr,
660 const char *buf, size_t len)
657{ 661{
658 long gpio; 662 long gpio;
659 int status; 663 int status;