diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-11-23 11:19:41 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-11-23 11:19:41 +0100 |
| commit | 8fb5fa5c9e538e3a5a08a1479c7c59d0e5d63d7a (patch) | |
| tree | e398a61e97ba25d1c30575382a4f701e56d3605e /c09.patch | |
| parent | e7d7dc0e0e7ab68f1845e11b7574d83ac8015e0e (diff) | |
| download | patches-8fb5fa5c9e538e3a5a08a1479c7c59d0e5d63d7a.tar.gz | |
more patches
Diffstat (limited to 'c09.patch')
| -rw-r--r-- | c09.patch | 79 |
1 files changed, 78 insertions, 1 deletions
diff --git a/c09.patch b/c09.patch index da3d6ecb6e8ff4..8023640ffecd35 100644 --- a/c09.patch +++ b/c09.patch @@ -1,3 +1,80 @@ --- - 0 files changed + drivers/block/pktcdvd.c | 35 +++++++++++++++++------------------ + 1 file changed, 17 insertions(+), 18 deletions(-) +--- a/drivers/block/pktcdvd.c ++++ b/drivers/block/pktcdvd.c +@@ -348,9 +348,9 @@ static void class_pktcdvd_release(struct + { + kfree(cls); + } +-static ssize_t class_pktcdvd_show_map(struct class *c, +- struct class_attribute *attr, +- char *data) ++ ++static ssize_t device_map_show(struct class *c, struct class_attribute *attr, ++ char *data) + { + int n = 0; + int idx; +@@ -368,11 +368,10 @@ static ssize_t class_pktcdvd_show_map(st + mutex_unlock(&ctl_mutex); + return n; + } ++static CLASS_ATTRIBUTE_RO(device_map); + +-static ssize_t class_pktcdvd_store_add(struct class *c, +- struct class_attribute *attr, +- const char *buf, +- size_t count) ++static ssize_t add_store(struct class *c, struct class_attribute *attr, ++ const char *buf, size_t count) + { + unsigned int major, minor; + +@@ -390,11 +389,10 @@ static ssize_t class_pktcdvd_store_add(s + + return -EINVAL; + } ++static CLASS_ATTRIBUTE_WO(add); + +-static ssize_t class_pktcdvd_store_remove(struct class *c, +- struct class_attribute *attr, +- const char *buf, +- size_t count) ++static ssize_t remove_store(struct class *c, struct class_attribute *attr, ++ const char *buf, size_t count) + { + unsigned int major, minor; + if (sscanf(buf, "%u:%u", &major, &minor) == 2) { +@@ -403,14 +401,15 @@ static ssize_t class_pktcdvd_store_remov + } + return -EINVAL; + } ++static CLASS_ATTRIBUTE_WO(remove); + +-static struct class_attribute class_pktcdvd_attrs[] = { +- __ATTR(add, 0200, NULL, class_pktcdvd_store_add), +- __ATTR(remove, 0200, NULL, class_pktcdvd_store_remove), +- __ATTR(device_map, 0444, class_pktcdvd_show_map, NULL), +- __ATTR_NULL ++static struct attribute *class_pktcdvd_attrs[] = { ++ &class_attr_add.attr, ++ &class_attr_remove.attr, ++ &class_attr_device_map.attr, ++ NULL, + }; +- ++ATTRIBUTE_GROUPS(class_pktcdvd); + + static int pkt_sysfs_init(void) + { +@@ -426,7 +425,7 @@ static int pkt_sysfs_init(void) + class_pktcdvd->name = DRIVER_NAME; + class_pktcdvd->owner = THIS_MODULE; + class_pktcdvd->class_release = class_pktcdvd_release; +- class_pktcdvd->class_attrs = class_pktcdvd_attrs; ++ class_pktcdvd->class_groups = class_pktcdvd_groups; + ret = class_register(class_pktcdvd); + if (ret) { + kfree(class_pktcdvd); |
