Skip to content

Commit 7b3ffe0

Browse files
Tero Kristoij-intel
authored andcommitted
platform/x86/intel-uncore-freq: Use generic helpers for current frequency
Use the generic sysfs helpers for reading the current frequency also, and remove the custom ones. No functional change intended. Signed-off-by: Tero Kristo <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent b2cc9f9 commit 7b3ffe0

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,6 @@ static ssize_t store_attr(struct uncore_data *data, const char *buf, ssize_t cou
7676
return count;
7777
}
7878

79-
static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
80-
{
81-
unsigned int freq;
82-
int ret;
83-
84-
mutex_lock(&uncore_lock);
85-
ret = uncore_read(data, &freq, UNCORE_INDEX_CURRENT_FREQ);
86-
mutex_unlock(&uncore_lock);
87-
if (ret)
88-
return ret;
89-
90-
return sprintf(buf, "%u\n", freq);
91-
}
92-
9379
#define store_uncore_attr(name, index) \
9480
static ssize_t store_##name(struct kobject *kobj, \
9581
struct kobj_attribute *attr, \
@@ -109,22 +95,13 @@ static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
10995
return show_attr(data, buf, index); \
11096
}
11197

112-
#define show_uncore_perf_status(name) \
113-
static ssize_t show_##name(struct kobject *kobj, \
114-
struct kobj_attribute *attr, char *buf)\
115-
{ \
116-
struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\
117-
\
118-
return show_perf_status_freq_khz(data, buf); \
119-
}
120-
12198
store_uncore_attr(min_freq_khz, UNCORE_INDEX_MIN_FREQ);
12299
store_uncore_attr(max_freq_khz, UNCORE_INDEX_MAX_FREQ);
123100

124101
show_uncore_attr(min_freq_khz, UNCORE_INDEX_MIN_FREQ);
125102
show_uncore_attr(max_freq_khz, UNCORE_INDEX_MAX_FREQ);
126103

127-
show_uncore_perf_status(current_freq_khz);
104+
show_uncore_attr(current_freq_khz, UNCORE_INDEX_CURRENT_FREQ);
128105

129106
#define show_uncore_data(member_name) \
130107
static ssize_t show_##member_name(struct kobject *kobj, \

0 commit comments

Comments
 (0)