PM-runtime: Call pm_runtime_active|suspended_time() from sysfs
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 5 Mar 2019 12:55:35 +0000 (13:55 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Mar 2019 10:23:17 +0000 (11:23 +0100)
commit0996584b3026bed7f38abe02e8535e6a6c474118
tree9fe33cd0609fab1a83532fd1e6c559b79d4fea8d
parentfdc56c073270af2f4d223c96a5fff3048352fc03
PM-runtime: Call pm_runtime_active|suspended_time() from sysfs

Avoid the open-coding of the accounted time acquisition in
runtime_active|suspend_time_show() and make them call
pm_runtime_active|suspended_time() instead.

Note that this change also indirectly avoids holding dev->power.lock
around the do_div() computation and the sprintf() call which is an
additional improvement.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[ rjw: Changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/runtime.c
drivers/base/power/sysfs.c
include/linux/pm.h