Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2
+2
drivers/devfreq/devfreq.c
··· 1049 1049 if (!devfreq->stop_polling && 1050 1050 devfreq_update_status(devfreq, devfreq->previous_freq)) 1051 1051 return 0; 1052 + if (max_state == 0) 1053 + return sprintf(buf, "Not Supported.\n"); 1052 1054 1053 1055 len = sprintf(buf, " From : To\n"); 1054 1056 len += sprintf(buf + len, " :");