Skip to content

Commit

Permalink
PM / devfreq: Do not show statistics if it's not ready.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
MyungJoo Ham committed Jan 13, 2016
1 parent d7df1e4 commit 34bd322
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, " :");
Expand Down

0 comments on commit 34bd322

Please sign in to comment.