summaryrefslogtreecommitdiff
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2015-11-23 09:45:36 +0300
committerMyungJoo Ham <myungjoo.ham@samsung.com>2016-01-13 11:30:33 +0300
commit34bd322070a41898b032f59a0dfd345627fc1e7e (patch)
treecb4d133152595cfff435ff193dee183497f387b8 /drivers/devfreq
parentd7df1e464749650056f511e75b3d4e53cfac5d53 (diff)
downloadlinux-34bd322070a41898b032f59a0dfd345627fc1e7e.tar.xz
PM / devfreq: Do not show statistics if it's not ready.
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>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/devfreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index d36fa2db4d29..984c5e9e7bdd 100644
--- 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, " :");