Loading drivers/thermal/thermal_sysfs.c +17 −1 Original line number Diff line number Diff line Loading @@ -898,6 +898,9 @@ void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev, { struct cooling_dev_stats *stats = cdev->stats; if (!stats) return; spin_lock(&stats->lock); if (stats->state == new_state) Loading @@ -919,6 +922,9 @@ static ssize_t total_trans_show(struct device *dev, struct cooling_dev_stats *stats = cdev->stats; int ret; if (!stats) return -ENODEV; spin_lock(&stats->lock); ret = sprintf(buf, "%u\n", stats->total_trans); spin_unlock(&stats->lock); Loading @@ -935,6 +941,9 @@ time_in_state_ms_show(struct device *dev, struct device_attribute *attr, ssize_t len = 0; int i; if (!stats) return -ENODEV; spin_lock(&stats->lock); update_time_in_state(stats); Loading @@ -953,8 +962,12 @@ reset_store(struct device *dev, struct device_attribute *attr, const char *buf, { struct thermal_cooling_device *cdev = to_cooling_device(dev); struct cooling_dev_stats *stats = cdev->stats; int i, states = stats->max_states; int i, states; if (!stats) return -ENODEV; states = stats->max_states; spin_lock(&stats->lock); stats->total_trans = 0; Loading @@ -978,6 +991,9 @@ static ssize_t trans_table_show(struct device *dev, ssize_t len = 0; int i, j; if (!stats) return -ENODEV; len += snprintf(buf + len, PAGE_SIZE - len, " From : To\n"); len += snprintf(buf + len, PAGE_SIZE - len, " : "); for (i = 0; i < stats->max_states; i++) { Loading Loading
drivers/thermal/thermal_sysfs.c +17 −1 Original line number Diff line number Diff line Loading @@ -898,6 +898,9 @@ void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev, { struct cooling_dev_stats *stats = cdev->stats; if (!stats) return; spin_lock(&stats->lock); if (stats->state == new_state) Loading @@ -919,6 +922,9 @@ static ssize_t total_trans_show(struct device *dev, struct cooling_dev_stats *stats = cdev->stats; int ret; if (!stats) return -ENODEV; spin_lock(&stats->lock); ret = sprintf(buf, "%u\n", stats->total_trans); spin_unlock(&stats->lock); Loading @@ -935,6 +941,9 @@ time_in_state_ms_show(struct device *dev, struct device_attribute *attr, ssize_t len = 0; int i; if (!stats) return -ENODEV; spin_lock(&stats->lock); update_time_in_state(stats); Loading @@ -953,8 +962,12 @@ reset_store(struct device *dev, struct device_attribute *attr, const char *buf, { struct thermal_cooling_device *cdev = to_cooling_device(dev); struct cooling_dev_stats *stats = cdev->stats; int i, states = stats->max_states; int i, states; if (!stats) return -ENODEV; states = stats->max_states; spin_lock(&stats->lock); stats->total_trans = 0; Loading @@ -978,6 +991,9 @@ static ssize_t trans_table_show(struct device *dev, ssize_t len = 0; int i, j; if (!stats) return -ENODEV; len += snprintf(buf + len, PAGE_SIZE - len, " From : To\n"); len += snprintf(buf + len, PAGE_SIZE - len, " : "); for (i = 0; i < stats->max_states; i++) { Loading