diff mbox

[V7] Report interrupt that caused system wakeup

Message ID 20150910073600.GB587@swordfish (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Sergey Senozhatsky Sept. 10, 2015, 7:36 a.m. UTC
On (09/09/15 19:48), Alexandra Yates wrote:

[..]
> +static ssize_t pm_last_wakeup_irq_store(struct kobject *kobj,
> +					struct kobj_attribute *attr,
> +					const char *buf, size_t n)
> +{
> +	return -EINVAL;
> +}
> +power_attr(pm_last_wakeup_irq);

a side note,
do you guys want to define a power_attr_ro() macro and to drop 'return -EINVAL'
*_show() functions: pm_trace_dev_match_store() and pm_last_wakeup_irq_store()?

---

 kernel/power/main.c  | 9 +--------
 kernel/power/power.h | 9 +++++++++
 2 files changed, 10 insertions(+), 8 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/kernel/power/main.c b/kernel/power/main.c
index 63d395b..0217a5c 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -548,14 +548,7 @@  static ssize_t pm_trace_dev_match_show(struct kobject *kobj,
 	return show_trace_dev_match(buf, PAGE_SIZE);
 }
 
-static ssize_t
-pm_trace_dev_match_store(struct kobject *kobj, struct kobj_attribute *attr,
-			 const char *buf, size_t n)
-{
-	return -EINVAL;
-}
-
-power_attr(pm_trace_dev_match);
+power_attr_ro(pm_trace_dev_match);
 
 #endif /* CONFIG_PM_TRACE */
 
diff --git a/kernel/power/power.h b/kernel/power/power.h
index caadb56..efe1b3b 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) */