cpufreq / stats: Get rid of CPUFREQ_STATDEVICE_ATTR
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 4 Feb 2013 11:38:52 +0000 (11:38 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 9 Feb 2013 00:18:40 +0000 (01:18 +0100)
Macro "CPUFREQ_STATDEVICE_ATTR" is defined local to cpufreq_stats.c file and is
almost a copy of the generic version present in cpufreq.h file. Lets use the
generic version instead.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_stats.c

index 572124c6e36b68edfafacdd6b305529a54b5d23b..a2dee4cedf417a8408a97139ab810d54856c5045 100644 (file)
 
 static spinlock_t cpufreq_stats_lock;
 
-#define CPUFREQ_STATDEVICE_ATTR(_name, _mode, _show) \
-static struct freq_attr _attr_##_name = {\
-       .attr = {.name = __stringify(_name), .mode = _mode, }, \
-       .show = _show,\
-};
-
 struct cpufreq_stats {
        unsigned int cpu;
        unsigned int total_trans;
@@ -136,17 +130,17 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
                return PAGE_SIZE;
        return len;
 }
-CPUFREQ_STATDEVICE_ATTR(trans_table, 0444, show_trans_table);
+cpufreq_freq_attr_ro(trans_table);
 #endif
 
-CPUFREQ_STATDEVICE_ATTR(total_trans, 0444, show_total_trans);
-CPUFREQ_STATDEVICE_ATTR(time_in_state, 0444, show_time_in_state);
+cpufreq_freq_attr_ro(total_trans);
+cpufreq_freq_attr_ro(time_in_state);
 
 static struct attribute *default_attrs[] = {
-       &_attr_total_trans.attr,
-       &_attr_time_in_state.attr,
+       &total_trans.attr,
+       &time_in_state.attr,
 #ifdef CONFIG_CPU_FREQ_STAT_DETAILS
-       &_attr_trans_table.attr,
+       &trans_table.attr,
 #endif
        NULL
 };