diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-14 15:52:23 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-14 15:52:23 -0700 |
| commit | ee87cfbacf73810697ae65af579dc6f193c520f5 (patch) | |
| tree | be389832d60926d5f1c50cd13d08204dfd72ef03 | |
| parent | 0b9b586eb80f4a85b512496ce2d7f389c7271d1c (diff) | |
| download | patches-ee87cfbacf73810697ae65af579dc6f193c520f5.tar.gz | |
updated and new patches
| -rw-r--r-- | driver-core-add-default-groups-to-struct-class.patch | 2 | ||||
| -rw-r--r-- | driver-core-add-device_attr_rw-and-device_attr_ro-macros.patch | 2 | ||||
| -rw-r--r-- | f2.patch | 6 | ||||
| -rw-r--r-- | f4.patch | 4 | ||||
| -rw-r--r-- | series | 3 | ||||
| -rw-r--r-- | sysfs-add-more-helper-macro-s-for-bin_-attribute-_groups.patch | 94 | ||||
| -rw-r--r-- | sysfs-add-support-for-binary-attributes-in-groups.patch | 4 | ||||
| -rw-r--r-- | sysfs-prevent-warning-when-only-using-binary-attributes.patch | 28 | ||||
| -rw-r--r-- | sysfs-use-file-mode-defines-from-stat.h.patch | 45 | ||||
| -rw-r--r-- | sysfs.h-add-__attr_rw-macro.patch | 2 | ||||
| -rw-r--r-- | sysfs.h-add-attribute_groups-macro.patch | 2 | ||||
| -rw-r--r-- | sysfs.h-add-bin_attr-macro.patch | 2 |
12 files changed, 188 insertions, 6 deletions
diff --git a/driver-core-add-default-groups-to-struct-class.patch b/driver-core-add-default-groups-to-struct-class.patch index b9fdfc05ff7445..af701f865c33fa 100644 --- a/driver-core-add-default-groups-to-struct-class.patch +++ b/driver-core-add-default-groups-to-struct-class.patch @@ -11,6 +11,8 @@ overall, so add them. The dev_attrs list will go away after all in-kernel users are converted to use dev_groups. +Reviewed-by: Guenter Roeck <linux@roeck-us.net> +Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/base/core.c | 9 ++++++++- diff --git a/driver-core-add-device_attr_rw-and-device_attr_ro-macros.patch b/driver-core-add-device_attr_rw-and-device_attr_ro-macros.patch index 492bb0de5cc31a..3dc53f256f316c 100644 --- a/driver-core-add-device_attr_rw-and-device_attr_ro-macros.patch +++ b/driver-core-add-device_attr_rw-and-device_attr_ro-macros.patch @@ -7,6 +7,8 @@ Subject: driver core: device.h: add RW and RO attribute macros Make it easier to create attributes without having to always audit the mode settings. +Reviewed-by: Guenter Roeck <linux@roeck-us.net> +Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- diff --git a/f2.patch b/f2.patch index 1df7c8d67ff1a0..d8eb2ce1a8b842 100644 --- a/f2.patch +++ b/f2.patch @@ -171,11 +171,11 @@ #define RIO_SET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x000000ff) << 16)) --- a/drivers/scsi/fcoe/fcoe_sysfs.c +++ b/drivers/scsi/fcoe/fcoe_sysfs.c -@@ -553,16 +553,20 @@ struct device_type fcoe_fcf_device_type +@@ -553,16 +553,20 @@ static struct device_type fcoe_fcf_devic .release = fcoe_fcf_device_release, }; --struct bus_attribute fcoe_bus_attr_group[] = { +-static struct bus_attribute fcoe_bus_attr_group[] = { - __ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store), - __ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store), - __ATTR_NULL @@ -189,7 +189,7 @@ }; +ATTRIBUTE_GROUPS(fcoe_bus); - struct bus_type fcoe_bus_type = { + static struct bus_type fcoe_bus_type = { .name = "fcoe", .match = &fcoe_bus_match, - .bus_attrs = fcoe_bus_attr_group, diff --git a/f4.patch b/f4.patch index 7a9a2787ac5bba..b9c452085282b8 100644 --- a/f4.patch +++ b/f4.patch @@ -186,7 +186,7 @@ const struct attribute_group **drv_groups; --- a/kernel/events/core.c +++ b/kernel/events/core.c -@@ -6167,6 +6167,7 @@ type_show(struct device *dev, struct dev +@@ -6189,6 +6189,7 @@ type_show(struct device *dev, struct dev return snprintf(page, PAGE_SIZE-1, "%d\n", pmu->type); } @@ -194,7 +194,7 @@ static ssize_t perf_event_mux_interval_ms_show(struct device *dev, -@@ -6211,17 +6212,19 @@ perf_event_mux_interval_ms_store(struct +@@ -6233,17 +6234,19 @@ perf_event_mux_interval_ms_store(struct return count; } @@ -6,10 +6,13 @@ sysfs.h-add-attribute_groups-macro.patch sysfs.h-add-bin_attr-macro.patch driver-core-add-device_attr_rw-and-device_attr_ro-macros.patch sysfs-add-support-for-binary-attributes-in-groups.patch +sysfs-prevent-warning-when-only-using-binary-attributes.patch driver-core-introduce-device_create_groups.patch driver-core-add-default-groups-to-struct-class.patch # dev_groups to struct class work +sysfs-add-more-helper-macro-s-for-bin_-attribute-_groups.patch +sysfs-use-file-mode-defines-from-stat.h.patch misc-c2port-use-dev_bin_attrs-instead-of-hand-coding-it.patch mips-convert-vpe_class-to-use-dev_groups.patch bsr-convert-bsr_class-to-use-dev_groups.patch diff --git a/sysfs-add-more-helper-macro-s-for-bin_-attribute-_groups.patch b/sysfs-add-more-helper-macro-s-for-bin_-attribute-_groups.patch new file mode 100644 index 00000000000000..e549896047c28d --- /dev/null +++ b/sysfs-add-more-helper-macro-s-for-bin_-attribute-_groups.patch @@ -0,0 +1,94 @@ +From 669597be47d042ee28abe5f7e172054043b003e7 Mon Sep 17 00:00:00 2001 +From: Oliver Schinagl <oliver@schinagl.nl> +Date: Thu, 11 Jul 2013 13:48:18 +0200 +Subject: sysfs: add more helper macro's for (bin_)attribute(_groups) + +With the recent changes to sysfs there's various helper macro's. +However there's no RW, RO BIN_ helper macro's. This patch adds them. + +Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + include/linux/sysfs.h | 51 +++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 38 insertions(+), 13 deletions(-) + +--- a/include/linux/sysfs.h ++++ b/include/linux/sysfs.h +@@ -17,6 +17,7 @@ + #include <linux/list.h> + #include <linux/lockdep.h> + #include <linux/kobject_ns.h> ++#include <linux/stat.h> + #include <linux/atomic.h> + + struct kobject; +@@ -94,15 +95,18 @@ struct attribute_group { + #define __ATTR_IGNORE_LOCKDEP __ATTR + #endif + +-#define ATTRIBUTE_GROUPS(name) \ +-static const struct attribute_group name##_group = { \ +- .attrs = name##_attrs, \ +-}; \ +-static const struct attribute_group *name##_groups[] = { \ +- &name##_group, \ ++#define __ATTRIBUTE_GROUPS(_name) \ ++static const struct attribute_group *_name##_groups[] = { \ ++ &_name##_group, \ + NULL, \ + } + ++#define ATTRIBUTE_GROUPS(_name) \ ++static const struct attribute_group _name##_group = { \ ++ .attrs = _name##_attrs, \ ++}; \ ++__ATTRIBUTE_GROUPS(_name) ++ + #define attr_name(_attr) (_attr).attr.name + + struct file; +@@ -132,15 +136,36 @@ struct bin_attribute { + */ + #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) + +-/* macro to create static binary attributes easier */ +-#define BIN_ATTR(_name, _mode, _read, _write, _size) \ +-struct bin_attribute bin_attr_##_name = { \ +- .attr = {.name = __stringify(_name), .mode = _mode }, \ +- .read = _read, \ +- .write = _write, \ +- .size = _size, \ ++/* macros to create static binary attributes easier */ ++#define __BIN_ATTR(_name, _mode, _read, _write, _size) { \ ++ .attr = { .name = __stringify(_name), .mode = _mode }, \ ++ .read = _read, \ ++ .write = _write, \ ++ .size = _size, \ ++} ++ ++#define __BIN_ATTR_RO(_name, _size) { \ ++ .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ ++ .read = _name##_read, \ ++ .size = _size, \ + } + ++#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \ ++ (S_IWUSR | S_IRUGO), _name##_read, \ ++ _name##_write) ++ ++#define __BIN_ATTR_NULL __ATTR_NULL ++ ++#define BIN_ATTR(_name, _mode, _read, _write, _size) \ ++struct bin_attribute bin_attr_##_name = __BIN_ATTR(_name, _mode, _read, \ ++ _write, _size) ++ ++#define BIN_ATTR_RO(_name, _size) \ ++struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size) ++ ++#define BIN_ATTR_RW(_name, _size) \ ++struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) ++ + struct sysfs_ops { + ssize_t (*show)(struct kobject *, struct attribute *,char *); + ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); diff --git a/sysfs-add-support-for-binary-attributes-in-groups.patch b/sysfs-add-support-for-binary-attributes-in-groups.patch index 42521e6488bcd2..3756614b6409f8 100644 --- a/sysfs-add-support-for-binary-attributes-in-groups.patch +++ b/sysfs-add-support-for-binary-attributes-in-groups.patch @@ -10,7 +10,9 @@ structure, groups, throughout the driver core and subsystems, making binary attributes a "full fledged" part of the driver model, and not something just "tacked on". -Reported-by: Oliver Schinagl <oliver+list@schinagl.nl> +Reported-by: Oliver Schinagl <oliver@schinagl.nl> +Reviewed-by: Guenter Roeck <linux@roeck-us.net> +Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- diff --git a/sysfs-prevent-warning-when-only-using-binary-attributes.patch b/sysfs-prevent-warning-when-only-using-binary-attributes.patch new file mode 100644 index 00000000000000..8c0774eca2aa93 --- /dev/null +++ b/sysfs-prevent-warning-when-only-using-binary-attributes.patch @@ -0,0 +1,28 @@ +From 5a4066011878134c1ab9412bc147c28c30f0fa4b Mon Sep 17 00:00:00 2001 +From: Oliver Schinagl <oliver@schinagl.nl> +Date: Thu, 11 Jul 2013 13:40:20 +0200 +Subject: sysfs: prevent warning when only using binary attributes + +When only using bin_attrs instead of attrs the kernel prints a warning +and refuses to create the sysfs entry. This fixes that. + +Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + fs/sysfs/group.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/sysfs/group.c ++++ b/fs/sysfs/group.c +@@ -93,8 +93,8 @@ static int internal_create_group(struct + /* Updates may happen before the object has been instantiated */ + if (unlikely(update && !kobj->sd)) + return -EINVAL; +- if (!grp->attrs) { +- WARN(1, "sysfs: attrs not set by subsystem for group: %s/%s\n", ++ if (!grp->attrs && !grp->bin_attrs) { ++ WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n", + kobj->name, grp->name ? "" : grp->name); + return -EINVAL; + } diff --git a/sysfs-use-file-mode-defines-from-stat.h.patch b/sysfs-use-file-mode-defines-from-stat.h.patch new file mode 100644 index 00000000000000..f96b8b73d4a665 --- /dev/null +++ b/sysfs-use-file-mode-defines-from-stat.h.patch @@ -0,0 +1,45 @@ +From a67de9f026363ce821c72a807d98830abece3cf7 Mon Sep 17 00:00:00 2001 +From: Oliver Schinagl <oliver@schinagl.nl> +Date: Thu, 11 Jul 2013 13:57:42 +0200 +Subject: sysfs: use file mode defines from stat.h + +With the last patches stat.h was included to the header, and thus those +permission defines should be used. + +Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + include/linux/sysfs.h | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +--- a/include/linux/sysfs.h ++++ b/include/linux/sysfs.h +@@ -69,18 +69,19 @@ struct attribute_group { + * for examples.. + */ + +-#define __ATTR(_name,_mode,_show,_store) { \ +- .attr = {.name = __stringify(_name), .mode = _mode }, \ +- .show = _show, \ +- .store = _store, \ ++#define __ATTR(_name,_mode,_show,_store) { \ ++ .attr = {.name = __stringify(_name), .mode = _mode }, \ ++ .show = _show, \ ++ .store = _store, \ + } + +-#define __ATTR_RO(_name) { \ +- .attr = { .name = __stringify(_name), .mode = 0444 }, \ +- .show = _name##_show, \ ++#define __ATTR_RO(_name) { \ ++ .attr = { .name = __stringify(_name), .mode = S_IRUGO }, \ ++ .show = _name##_show, \ + } + +-#define __ATTR_RW(_name) __ATTR(_name, 0644, _name##_show, _name##_store) ++#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ ++ _name##_show, _name##_store) + + #define __ATTR_NULL { .attr = { .name = NULL } } + diff --git a/sysfs.h-add-__attr_rw-macro.patch b/sysfs.h-add-__attr_rw-macro.patch index 38bdd0772a2e05..e23971cb88196d 100644 --- a/sysfs.h-add-__attr_rw-macro.patch +++ b/sysfs.h-add-__attr_rw-macro.patch @@ -7,6 +7,8 @@ Subject: sysfs.h: add __ATTR_RW() macro A number of parts of the kernel created their own version of this, might as well have the sysfs core provide it instead. +Reviewed-by: Guenter Roeck <linux@roeck-us.net> +Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- include/linux/sysfs.h | 2 ++ diff --git a/sysfs.h-add-attribute_groups-macro.patch b/sysfs.h-add-attribute_groups-macro.patch index 31816858e04505..c6775e4880130a 100644 --- a/sysfs.h-add-attribute_groups-macro.patch +++ b/sysfs.h-add-attribute_groups-macro.patch @@ -8,6 +8,8 @@ To make it easier for driver subsystems to work with attribute groups, create the ATTRIBUTE_GROUPS macro to remove some of the repetitive typing for the most common use for attribute groups. +Reviewed-by: Guenter Roeck <linux@roeck-us.net> +Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- include/linux/sysfs.h | 9 +++++++++ diff --git a/sysfs.h-add-bin_attr-macro.patch b/sysfs.h-add-bin_attr-macro.patch index 0b024198d00356..f3a1c5b230f365 100644 --- a/sysfs.h-add-bin_attr-macro.patch +++ b/sysfs.h-add-bin_attr-macro.patch @@ -7,6 +7,8 @@ Subject: sysfs.h: add BIN_ATTR macro This makes it easier to create static binary attributes, which is needed in a number of drivers, instead of "open coding" them. +Reviewed-by: Guenter Roeck <linux@roeck-us.net> +Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- include/linux/sysfs.h | 9 +++++++++ |
