diff options
| -rw-r--r-- | drivers/base/power/runtime.c | 2 | ||||
| -rw-r--r-- | drivers/base/power/sysfs.c | 12 | ||||
| -rw-r--r-- | include/linux/pm.h | 1 |
3 files changed, 3 insertions, 12 deletions
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 32f6bf076bd7..a2d22e3ecf3a 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c | |||
| @@ -64,7 +64,7 @@ static int rpm_suspend(struct device *dev, int rpmflags); | |||
| 64 | * runtime_status field is updated, to account the time in the old state | 64 | * runtime_status field is updated, to account the time in the old state |
| 65 | * correctly. | 65 | * correctly. |
| 66 | */ | 66 | */ |
| 67 | void update_pm_runtime_accounting(struct device *dev) | 67 | static void update_pm_runtime_accounting(struct device *dev) |
| 68 | { | 68 | { |
| 69 | u64 now, last, delta; | 69 | u64 now, last, delta; |
| 70 | 70 | ||
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c index c6bf76124184..1226e441ddfe 100644 --- a/drivers/base/power/sysfs.c +++ b/drivers/base/power/sysfs.c | |||
| @@ -125,13 +125,9 @@ static ssize_t runtime_active_time_show(struct device *dev, | |||
| 125 | struct device_attribute *attr, char *buf) | 125 | struct device_attribute *attr, char *buf) |
| 126 | { | 126 | { |
| 127 | int ret; | 127 | int ret; |
| 128 | u64 tmp; | 128 | u64 tmp = pm_runtime_active_time(dev); |
| 129 | spin_lock_irq(&dev->power.lock); | ||
| 130 | update_pm_runtime_accounting(dev); | ||
| 131 | tmp = dev->power.active_time; | ||
| 132 | do_div(tmp, NSEC_PER_MSEC); | 129 | do_div(tmp, NSEC_PER_MSEC); |
| 133 | ret = sprintf(buf, "%llu\n", tmp); | 130 | ret = sprintf(buf, "%llu\n", tmp); |
| 134 | spin_unlock_irq(&dev->power.lock); | ||
| 135 | return ret; | 131 | return ret; |
| 136 | } | 132 | } |
| 137 | 133 | ||
| @@ -141,13 +137,9 @@ static ssize_t runtime_suspended_time_show(struct device *dev, | |||
| 141 | struct device_attribute *attr, char *buf) | 137 | struct device_attribute *attr, char *buf) |
| 142 | { | 138 | { |
| 143 | int ret; | 139 | int ret; |
| 144 | u64 tmp; | 140 | u64 tmp = pm_runtime_suspended_time(dev); |
| 145 | spin_lock_irq(&dev->power.lock); | ||
| 146 | update_pm_runtime_accounting(dev); | ||
| 147 | tmp = dev->power.suspended_time; | ||
| 148 | do_div(tmp, NSEC_PER_MSEC); | 141 | do_div(tmp, NSEC_PER_MSEC); |
| 149 | ret = sprintf(buf, "%llu\n", tmp); | 142 | ret = sprintf(buf, "%llu\n", tmp); |
| 150 | spin_unlock_irq(&dev->power.lock); | ||
| 151 | return ret; | 143 | return ret; |
| 152 | } | 144 | } |
| 153 | 145 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 06f7ed893928..66c19a65a514 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -643,7 +643,6 @@ struct dev_pm_info { | |||
| 643 | struct dev_pm_qos *qos; | 643 | struct dev_pm_qos *qos; |
| 644 | }; | 644 | }; |
| 645 | 645 | ||
| 646 | extern void update_pm_runtime_accounting(struct device *dev); | ||
| 647 | extern int dev_pm_get_subsys_data(struct device *dev); | 646 | extern int dev_pm_get_subsys_data(struct device *dev); |
| 648 | extern void dev_pm_put_subsys_data(struct device *dev); | 647 | extern void dev_pm_put_subsys_data(struct device *dev); |
| 649 | 648 | ||
