summaryrefslogtreecommitdiff
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
authorKevin Hao <haokexin@gmail.com>2022-01-23 15:45:06 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-02-04 21:22:34 +0300
commitae26508651272695a3ab353f75ab9a8daf3da324 (patch)
treefa18334b2f77740d5ec54d6aff8d0de4ff2de2a7 /include/linux/cpufreq.h
parent26291c54e111ff6ba87a164d85d4a4e134b7315c (diff)
downloadlinux-ae26508651272695a3ab353f75ab9a8daf3da324.tar.xz
cpufreq: Move to_gov_attr_set() to cpufreq.h
So it can be reused by other codes. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 1ab29e61b078..f0dfc0b260ec 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -658,6 +658,11 @@ struct gov_attr_set {
/* sysfs ops for cpufreq governors */
extern const struct sysfs_ops governor_sysfs_ops;
+static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
+{
+ return container_of(kobj, struct gov_attr_set, kobj);
+}
+
void gov_attr_set_init(struct gov_attr_set *attr_set, struct list_head *list_node);
void gov_attr_set_get(struct gov_attr_set *attr_set, struct list_head *list_node);
unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *list_node);