aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/pktcdvd.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/pktcdvd.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/pktcdvd.c')
-rw-r--r--drivers/block/pktcdvd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index b72935b8f203..73d815d3f1b2 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -337,7 +337,9 @@ static void class_pktcdvd_release(struct class *cls)
337{ 337{
338 kfree(cls); 338 kfree(cls);
339} 339}
340static ssize_t class_pktcdvd_show_map(struct class *c, char *data) 340static ssize_t class_pktcdvd_show_map(struct class *c,
341 struct class_attribute *attr,
342 char *data)
341{ 343{
342 int n = 0; 344 int n = 0;
343 int idx; 345 int idx;
@@ -356,7 +358,9 @@ static ssize_t class_pktcdvd_show_map(struct class *c, char *data)
356 return n; 358 return n;
357} 359}
358 360
359static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf, 361static ssize_t class_pktcdvd_store_add(struct class *c,
362 struct class_attribute *attr,
363 const char *buf,
360 size_t count) 364 size_t count)
361{ 365{
362 unsigned int major, minor; 366 unsigned int major, minor;
@@ -376,7 +380,9 @@ static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf,
376 return -EINVAL; 380 return -EINVAL;
377} 381}
378 382
379static ssize_t class_pktcdvd_store_remove(struct class *c, const char *buf, 383static ssize_t class_pktcdvd_store_remove(struct class *c,
384 struct class_attribute *attr,
385 const char *buf,
380 size_t count) 386 size_t count)
381{ 387{
382 unsigned int major, minor; 388 unsigned int major, minor;