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 | |
parent | e7d7dc0e0e7ab68f1845e11b7574d83ac8015e0e (diff) | |
download | patches-8fb5fa5c9e538e3a5a08a1479c7c59d0e5d63d7a.tar.gz |
more patches
-rw-r--r-- | c09.patch | 79 | ||||
-rw-r--r-- | c10.patch | 51 | ||||
-rw-r--r-- | c99.patch | 91 | ||||
-rw-r--r-- | class_wo.patch | 12 | ||||
-rw-r--r-- | series | 30 |
5 files changed, 249 insertions, 14 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); diff --git a/c10.patch b/c10.patch new file mode 100644 index 00000000000000..422409d813db94 --- /dev/null +++ b/c10.patch @@ -0,0 +1,51 @@ +--- + arch/avr32/boards/merisc/merisc_sysfs.c | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +--- a/arch/avr32/boards/merisc/merisc_sysfs.c ++++ b/arch/avr32/boards/merisc/merisc_sysfs.c +@@ -18,7 +18,7 @@ + #include <linux/ctype.h> + #include "merisc.h" + +-static ssize_t merisc_model_show(struct class *class, char *buf) ++static ssize_t model_show(struct class *class, char *buf) + { + ssize_t ret = 0; + +@@ -27,8 +27,9 @@ static ssize_t merisc_model_show(struct + + return ret; + } ++static CLASS_ATTRIBUTE_RO(model); + +-static ssize_t merisc_revision_show(struct class *class, char *buf) ++static ssize_t revision_show(struct class *class, char *buf) + { + ssize_t ret = 0; + +@@ -37,17 +38,19 @@ static ssize_t merisc_revision_show(stru + + return ret; + } ++static CLASS_ATTRIBUTE_RO(revision); + +-static struct class_attribute merisc_class_attrs[] = { +- __ATTR(model, S_IRUGO, merisc_model_show, NULL), +- __ATTR(revision, S_IRUGO, merisc_revision_show, NULL), +- __ATTR_NULL, ++static struct attribute *merisc_class_attrs[] = { ++ &class_attr_model.attr, ++ &class_attr_revision.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(merisc_class); + + struct class merisc_class = { + .name = "merisc", + .owner = THIS_MODULE, +- .class_attrs = merisc_class_attrs, ++ .class_groups = merisc_class_groups, + }; + + static int __init merisc_sysfs_init(void) diff --git a/c99.patch b/c99.patch new file mode 100644 index 00000000000000..e1847596abfb8f --- /dev/null +++ b/c99.patch @@ -0,0 +1,91 @@ +From foo@baz Wed Nov 23 11:18:27 CET 2016 +Date: Wed, 23 Nov 2016 11:18:27 +0100 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: remove class_attrs from struct class + +This field is no longer used or needed (use class_groups instead), so it +can be removed along with the driver core functionality that created and +removed these files. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/base/class.c | 33 --------------------------------- + include/linux/device.h | 2 -- + 2 files changed, 35 deletions(-) + +--- a/drivers/base/class.c ++++ b/drivers/base/class.c +@@ -119,36 +119,6 @@ static void class_put(struct class *cls) + kset_put(&cls->p->subsys); + } + +-static int add_class_attrs(struct class *cls) +-{ +- int i; +- int error = 0; +- +- if (cls->class_attrs) { +- for (i = 0; cls->class_attrs[i].attr.name; i++) { +- error = class_create_file(cls, &cls->class_attrs[i]); +- if (error) +- goto error; +- } +- } +-done: +- return error; +-error: +- while (--i >= 0) +- class_remove_file(cls, &cls->class_attrs[i]); +- goto done; +-} +- +-static void remove_class_attrs(struct class *cls) +-{ +- int i; +- +- if (cls->class_attrs) { +- for (i = 0; cls->class_attrs[i].attr.name; i++) +- class_remove_file(cls, &cls->class_attrs[i]); +- } +-} +- + static void klist_class_dev_get(struct klist_node *n) + { + struct device *dev = container_of(n, struct device, knode_class); +@@ -217,8 +187,6 @@ int __class_register(struct class *cls, + } + error = class_add_groups(class_get(cls), cls->class_groups); + class_put(cls); +- error = add_class_attrs(class_get(cls)); +- class_put(cls); + return error; + } + EXPORT_SYMBOL_GPL(__class_register); +@@ -226,7 +194,6 @@ EXPORT_SYMBOL_GPL(__class_register); + void class_unregister(struct class *cls) + { + pr_debug("device class '%s': unregistering\n", cls->name); +- remove_class_attrs(cls); + class_remove_groups(cls, cls->class_groups); + kset_unregister(&cls->p->subsys); + } +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -359,7 +359,6 @@ int subsys_virtual_register(struct bus_t + * struct class - device classes + * @name: Name of the class. + * @owner: The module owner. +- * @class_attrs: Default attributes of this class. + * @class_groups: Default attributes of this class. + * @dev_groups: Default attributes of the devices that belong to the class. + * @dev_kobj: The kobject that represents this class and links it into the hierarchy. +@@ -388,7 +387,6 @@ struct class { + const char *name; + struct module *owner; + +- struct class_attribute *class_attrs; + const struct attribute_group **class_groups; + const struct attribute_group **dev_groups; + struct kobject *dev_kobj; diff --git a/class_wo.patch b/class_wo.patch index 2806ecd1ac660b..5bf798fd3cf73c 100644 --- a/class_wo.patch +++ b/class_wo.patch @@ -1,3 +1,15 @@ +From foo@baz Tue Nov 22 18:29:57 CET 2016 +Date: Tue, 22 Nov 2016 18:29:57 +0100 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: [PATCH] driver core: add CLASS_ATTR_WO() + +Some class subsystems are open-coding CLASS_ATTR_WO because the driver +core never provided it. Add the macro to device.h so that we can go +around and fix up the individual subsystems as needed. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + --- include/linux/device.h | 2 ++ 1 file changed, 2 insertions(+) @@ -51,6 +51,22 @@ p26.patch p27.patch p28.patch p29.patch +p30.patch +p31.patch +c00.patch +c01.patch +c02.patch +c03.patch +c04.patch +c05.patch +c06.patch +class_wo.patch +c07.patch +c08.patch +c09.patch +c10.patch +c99.patch + # #qlcnic_sysfs.patch # @@ -67,16 +83,4 @@ p29.patch # # # -p30.patch -p31.patch -c00.patch -c01.patch -c02.patch -c03.patch -c04.patch -c05.patch -c06.patch -class_wo.patch -c07.patch -c08.patch -c09.patch + |