aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/osdblk.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/block/osdblk.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/block/osdblk.c')
-rw-r--r--drivers/block/osdblk.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c
index a808b1530b3b..eb2091aa1c19 100644
--- a/drivers/block/osdblk.c
+++ b/drivers/block/osdblk.c
@@ -476,7 +476,9 @@ static void class_osdblk_release(struct class *cls)
476 kfree(cls); 476 kfree(cls);
477} 477}
478 478
479static ssize_t class_osdblk_list(struct class *c, char *data) 479static ssize_t class_osdblk_list(struct class *c,
480 struct class_attribute *attr,
481 char *data)
480{ 482{
481 int n = 0; 483 int n = 0;
482 struct list_head *tmp; 484 struct list_head *tmp;
@@ -500,7 +502,9 @@ static ssize_t class_osdblk_list(struct class *c, char *data)
500 return n; 502 return n;
501} 503}
502 504
503static ssize_t class_osdblk_add(struct class *c, const char *buf, size_t count) 505static ssize_t class_osdblk_add(struct class *c,
506 struct class_attribute *attr,
507 const char *buf, size_t count)
504{ 508{
505 struct osdblk_device *osdev; 509 struct osdblk_device *osdev;
506 ssize_t rc; 510 ssize_t rc;
@@ -592,7 +596,9 @@ err_out_mod:
592 return rc; 596 return rc;
593} 597}
594 598
595static ssize_t class_osdblk_remove(struct class *c, const char *buf, 599static ssize_t class_osdblk_remove(struct class *c,
600 struct class_attribute *attr,
601 const char *buf,
596 size_t count) 602 size_t count)
597{ 603{
598 struct osdblk_device *osdev = NULL; 604 struct osdblk_device *osdev = NULL;