Skip to content

Commit 66893b6

Browse files
committed
cpufreq: Move governor attribute set headers to cpufreq.h
Move definitions and function headers related to struct gov_attr_set to include/linux/cpufreq.h so they can be used by (future) goverernors located outside of drivers/cpufreq/. No functional changes. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Viresh Kumar <[email protected]>
1 parent 2d0c58a commit 66893b6

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

drivers/cpufreq/cpufreq_governor.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,6 @@
4141
/* Ondemand Sampling types */
4242
enum {OD_NORMAL_SAMPLE, OD_SUB_SAMPLE};
4343

44-
struct gov_attr_set {
45-
struct kobject kobj;
46-
struct list_head policy_list;
47-
struct mutex update_lock;
48-
int usage_count;
49-
};
50-
51-
extern const struct sysfs_ops governor_sysfs_ops;
52-
53-
void gov_attr_set_init(struct gov_attr_set *attr_set, struct list_head *list_node);
54-
void gov_attr_set_get(struct gov_attr_set *attr_set, struct list_head *list_node);
55-
unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *list_node);
56-
5744
/*
5845
* Abbreviations:
5946
* dbs: used as a shortform for demand based switching It helps to keep variable
@@ -80,14 +67,6 @@ static inline struct dbs_data *to_dbs_data(struct gov_attr_set *attr_set)
8067
return container_of(attr_set, struct dbs_data, attr_set);
8168
}
8269

83-
/* Governor's specific attributes */
84-
struct governor_attr {
85-
struct attribute attr;
86-
ssize_t (*show)(struct gov_attr_set *attr_set, char *buf);
87-
ssize_t (*store)(struct gov_attr_set *attr_set, const char *buf,
88-
size_t count);
89-
};
90-
9170
#define gov_show_one(_gov, file_name) \
9271
static ssize_t show_##file_name \
9372
(struct gov_attr_set *attr_set, char *buf) \

include/linux/cpufreq.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,29 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor);
462462
struct cpufreq_governor *cpufreq_default_governor(void);
463463
struct cpufreq_governor *cpufreq_fallback_governor(void);
464464

465+
/* Governor attribute set */
466+
struct gov_attr_set {
467+
struct kobject kobj;
468+
struct list_head policy_list;
469+
struct mutex update_lock;
470+
int usage_count;
471+
};
472+
473+
/* sysfs ops for cpufreq governors */
474+
extern const struct sysfs_ops governor_sysfs_ops;
475+
476+
void gov_attr_set_init(struct gov_attr_set *attr_set, struct list_head *list_node);
477+
void gov_attr_set_get(struct gov_attr_set *attr_set, struct list_head *list_node);
478+
unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *list_node);
479+
480+
/* Governor sysfs attribute */
481+
struct governor_attr {
482+
struct attribute attr;
483+
ssize_t (*show)(struct gov_attr_set *attr_set, char *buf);
484+
ssize_t (*store)(struct gov_attr_set *attr_set, const char *buf,
485+
size_t count);
486+
};
487+
465488
/*********************************************************************
466489
* FREQUENCY TABLE HELPERS *
467490
*********************************************************************/

0 commit comments

Comments
 (0)