aboutsummaryrefslogtreecommitdiffstats
path: root/sysfs-use-file-mode-defines-from-stat.h.patch
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-14 15:52:23 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-14 15:52:23 -0700
commitee87cfbacf73810697ae65af579dc6f193c520f5 (patch)
treebe389832d60926d5f1c50cd13d08204dfd72ef03 /sysfs-use-file-mode-defines-from-stat.h.patch
parent0b9b586eb80f4a85b512496ce2d7f389c7271d1c (diff)
downloadpatches-ee87cfbacf73810697ae65af579dc6f193c520f5.tar.gz
updated and new patches
Diffstat (limited to 'sysfs-use-file-mode-defines-from-stat.h.patch')
-rw-r--r--sysfs-use-file-mode-defines-from-stat.h.patch45
1 files changed, 45 insertions, 0 deletions
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 } }
+