diff options
author | Andi Kleen <andi@firstfloor.org> | 2010-01-05 12:48:09 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-07 17:04:48 -0800 |
commit | 0933e2d98d1b170ef62d48e18157f5dc43b58217 (patch) | |
tree | ecbd589b7607cda35743faf65c8f4326fc8373dd /drivers/staging | |
parent | 869dfc875e32fd832385fd52ce54525a10401ed6 (diff) |
driver core: Convert some drivers to CLASS_ATTR_STRING
Convert some drivers who export a single string as class attribute
to the new class_attr_string functions. This removes redundant
code all over.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/asus_oled/asus_oled.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c index 7d93f50a0a64..7ebecc92c61b 100644 --- a/drivers/staging/asus_oled/asus_oled.c +++ b/drivers/staging/asus_oled/asus_oled.c @@ -770,15 +770,8 @@ static struct usb_driver oled_driver = { .id_table = id_table, }; -static ssize_t version_show(struct class *dev, - struct class_attribute *attr, - char *buf) -{ - return sprintf(buf, ASUS_OLED_UNDERSCORE_NAME " %s\n", - ASUS_OLED_VERSION); -} - -static CLASS_ATTR(version, S_IRUGO, version_show, NULL); +static CLASS_ATTR_STRING(version, S_IRUGO, + ASUS_OLED_UNDERSCORE_NAME " " ASUS_OLED_VERSION); static int __init asus_oled_init(void) { @@ -790,7 +783,7 @@ static int __init asus_oled_init(void) return PTR_ERR(oled_class); } - retval = class_create_file(oled_class, &class_attr_version); + retval = class_create_file(oled_class, &class_attr_version.attr); if (retval) { err("Error creating class version file"); goto error; @@ -812,7 +805,7 @@ error: static void __exit asus_oled_exit(void) { - class_remove_file(oled_class, &class_attr_version); + class_remove_file(oled_class, &class_attr_version.attr); class_destroy(oled_class); usb_deregister(&oled_driver); |