Freq attribute for "trans_table" is defined right after its callback (without any blank line between them), but the others are defined separately later on. Keep this consistent and define all attributes right after their callbacks.
Unified · Split
| @@ -51,6 +51,7 @@ static ssize_t show_total_trans(struct cpufreq_policy *policy, char *buf) · 50 unmodified lines | ||
| 51 | 51 | { |
| 52 | 52 | return sprintf(buf, "%d\n", policy->stats->total_trans); |
| 53 | 53 | } |
| 54 | +cpufreq_freq_attr_ro(total_trans); | |
| 54 | 55 | |
| 55 | 56 | static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf) |
| 56 | 57 | { |
| @@ -69,6 +70,7 @@ static ssize_t show_time_in_state(struct cpufreq_policy *policy, char *buf) · 12 unmodified lines | ||
| 69 | 70 | } |
| 70 | 71 | return len; |
| 71 | 72 | } |
| 73 | +cpufreq_freq_attr_ro(time_in_state); | |
| 72 | 74 | |
| 73 | 75 | static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf, |
| 74 | 76 | size_t count) |
| @@ -77,6 +79,7 @@ static ssize_t store_reset(struct cpufreq_policy *policy, const char *buf, · 2 unmodified lines | ||
| 77 | 79 | cpufreq_stats_clear_table(policy->stats); |
| 78 | 80 | return count; |
| 79 | 81 | } |
| 82 | +cpufreq_freq_attr_wo(reset); | |
| 80 | 83 | |
| 81 | 84 | static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf) |
| 82 | 85 | { |
| @@ -126,10 +129,6 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf) · 43 unmodified lines | ||
| 126 | 129 | } |
| 127 | 130 | cpufreq_freq_attr_ro(trans_table); |
| 128 | 131 | |
| 129 | −cpufreq_freq_attr_ro(total_trans); | |
| 130 | −cpufreq_freq_attr_ro(time_in_state); | |
| 131 | −cpufreq_freq_attr_wo(reset); | |
| 132 | − | |
| 133 | 132 | static struct attribute *default_attrs[] = { |
| 134 | 133 | &total_trans.attr, |
| 135 | 134 | &time_in_state.attr, |