diff options
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r-- | drivers/base/class.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index 6e2c3b064f53..0147f476b8a9 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -31,7 +31,7 @@ static ssize_t class_attr_show(struct kobject *kobj, struct attribute *attr, | |||
31 | ssize_t ret = -EIO; | 31 | ssize_t ret = -EIO; |
32 | 32 | ||
33 | if (class_attr->show) | 33 | if (class_attr->show) |
34 | ret = class_attr->show(cp->class, buf); | 34 | ret = class_attr->show(cp->class, class_attr, buf); |
35 | return ret; | 35 | return ret; |
36 | } | 36 | } |
37 | 37 | ||
@@ -43,7 +43,7 @@ static ssize_t class_attr_store(struct kobject *kobj, struct attribute *attr, | |||
43 | ssize_t ret = -EIO; | 43 | ssize_t ret = -EIO; |
44 | 44 | ||
45 | if (class_attr->store) | 45 | if (class_attr->store) |
46 | ret = class_attr->store(cp->class, buf, count); | 46 | ret = class_attr->store(cp->class, class_attr, buf, count); |
47 | return ret; | 47 | return ret; |
48 | } | 48 | } |
49 | 49 | ||
@@ -63,7 +63,7 @@ static void class_release(struct kobject *kobj) | |||
63 | kfree(cp); | 63 | kfree(cp); |
64 | } | 64 | } |
65 | 65 | ||
66 | static struct sysfs_ops class_sysfs_ops = { | 66 | static const struct sysfs_ops class_sysfs_ops = { |
67 | .show = class_attr_show, | 67 | .show = class_attr_show, |
68 | .store = class_attr_store, | 68 | .store = class_attr_store, |
69 | }; | 69 | }; |
@@ -490,6 +490,16 @@ void class_interface_unregister(struct class_interface *class_intf) | |||
490 | class_put(parent); | 490 | class_put(parent); |
491 | } | 491 | } |
492 | 492 | ||
493 | ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr, | ||
494 | char *buf) | ||
495 | { | ||
496 | struct class_attribute_string *cs; | ||
497 | cs = container_of(attr, struct class_attribute_string, attr); | ||
498 | return snprintf(buf, PAGE_SIZE, "%s\n", cs->str); | ||
499 | } | ||
500 | |||
501 | EXPORT_SYMBOL_GPL(show_class_attr_string); | ||
502 | |||
493 | struct class_compat { | 503 | struct class_compat { |
494 | struct kobject *kobj; | 504 | struct kobject *kobj; |
495 | }; | 505 | }; |