projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7df1e4
)
PM / devfreq: Do not show statistics if it's not ready.
author
MyungJoo Ham
<myungjoo.ham@samsung.com>
Mon, 23 Nov 2015 06:45:36 +0000
(15:45 +0900)
committer
MyungJoo Ham
<myungjoo.ham@samsung.com>
Wed, 13 Jan 2016 08:30:33 +0000
(17:30 +0900)
Before this patch for a device without statistics support,
$ cat trans_stat
From : To
: time(ms)
Total transitions : 0
$
After this patch applied for such a device,
$ cat trans_stat
Not Supported.
$
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
drivers/devfreq/devfreq.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/devfreq/devfreq.c
b/drivers/devfreq/devfreq.c
index d36fa2db4d29aa8e871de8d4b56d03e0ccafdd5b..984c5e9e7bdd5bd72f66d0706661435f17b20b85 100644
(file)
--- a/
drivers/devfreq/devfreq.c
+++ b/
drivers/devfreq/devfreq.c
@@
-1049,6
+1049,8
@@
static ssize_t trans_stat_show(struct device *dev,
if (!devfreq->stop_polling &&
devfreq_update_status(devfreq, devfreq->previous_freq))
return 0;
+ if (max_state == 0)
+ return sprintf(buf, "Not Supported.\n");
len = sprintf(buf, " From : To\n");
len += sprintf(buf + len, " :");