From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: tglx@linutronix.de,
Alexandra Yates <alexandra.yates@linux.intel.com>,
kristen.c.accardi@intel.com, linux-pm@vger.kernel.org
Subject: Re: [PATCH V7] Report interrupt that caused system wakeup
Date: Thu, 10 Sep 2015 16:36:00 +0900 [thread overview]
Message-ID: <20150910073600.GB587@swordfish> (raw)
In-Reply-To: <1441853301-3816-1-git-send-email-alexandra.yates@linux.intel.com>
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(-)
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) */
next prev parent reply other threads:[~2015-09-10 7:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <[PATCH V7] Report interrupt that caused system wakeup>
2015-09-10 2:48 ` [PATCH V7] Report interrupt that caused system wakeup Alexandra Yates
2015-09-10 7:36 ` Sergey Senozhatsky [this message]
2015-09-10 14:14 ` Alan Stern
2015-09-10 18:42 ` Alexandra Yates
2015-09-10 19:15 ` Alan Stern
2015-09-10 22:21 ` Rafael J. Wysocki
2015-09-11 14:07 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150910073600.GB587@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=alexandra.yates@linux.intel.com \
--cc=kristen.c.accardi@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).