summaryrefslogtreecommitdiffstats
path: root/kernel/power/power.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-02 03:09:16 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-01-04 22:28:59 +0100
commita1e9ca6967d68209c70e616a224efa89a6b86ca6 (patch)
tree5de17c38e1f91798105a401d8cbfe84e63f6eeae /kernel/power/power.h
parentPM / sleep: prohibit devices probing during suspend/hibernation (diff)
downloadlinux-a1e9ca6967d68209c70e616a224efa89a6b86ca6.tar.xz
linux-a1e9ca6967d68209c70e616a224efa89a6b86ca6.zip
PM / sleep: Add support for read-only sysfs attributes
Some sysfs attributes in /sys/power/ should really be read-only, so add support for that, convert those attributes to read-only and drop the stub .show() routines from them. Original-by: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r--kernel/power/power.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h
index caadb566e82b..efe1b3b17c88 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -77,6 +77,15 @@ static struct kobj_attribute _name##_attr = { \
.store = _name##_store, \
}
+#define power_attr_ro(_name) \
+static struct kobj_attribute _name##_attr = { \
+ .attr = { \
+ .name = __stringify(_name), \
+ .mode = S_IRUGO, \
+ }, \
+ .show = _name##_show, \
+}
+
/* Preferred image size in bytes (default 500 MB) */
extern unsigned long image_size;
/* Size of memory reserved for drivers (default SPARE_PAGES x PAGE_SIZE) */