PM-runtime: update time accounting only when enabled
authorVincent Guittot <vincent.guittot@linaro.org>
Mon, 4 Feb 2019 16:25:53 +0000 (17:25 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 5 Feb 2019 11:04:39 +0000 (12:04 +0100)
commitfed7e88c0702e30fcd55563ca6eecd548a5d13af
treefdf48e512e455ef7655c3632879befb400768f0c
parentc155f6499f9797f200aa46eb3ccbf198f4206970
PM-runtime: update time accounting only when enabled

Update the accounting_timestamp field only when PM runtime is enabled
and don't forget to account the last state before disabling it.

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
[ rjw: Minor cleanups ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/runtime.c