mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
UPSTREAM: 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>
(cherry picked from commit 34bd322070)
Change-Id: Iae8a0e839cdd9b6d2e1c5c1332d85796b928f535
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -1138,6 +1138,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, " :");
|
||||
|
||||
Reference in New Issue
Block a user