Skip to content

Commit ae26508

Browse files
haokexinrafaeljw
authored andcommitted
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>
1 parent 26291c5 commit ae26508

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/cpufreq/cpufreq_governor_attr_set.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
#include "cpufreq_governor.h"
1010

11-
static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
12-
{
13-
return container_of(kobj, struct gov_attr_set, kobj);
14-
}
15-
1611
static inline struct governor_attr *to_gov_attr(struct attribute *attr)
1712
{
1813
return container_of(attr, struct governor_attr, attr);

include/linux/cpufreq.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,11 @@ struct gov_attr_set {
658658
/* sysfs ops for cpufreq governors */
659659
extern const struct sysfs_ops governor_sysfs_ops;
660660

661+
static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
662+
{
663+
return container_of(kobj, struct gov_attr_set, kobj);
664+
}
665+
661666
void gov_attr_set_init(struct gov_attr_set *attr_set, struct list_head *list_node);
662667
void gov_attr_set_get(struct gov_attr_set *attr_set, struct list_head *list_node);
663668
unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *list_node);

0 commit comments

Comments
 (0)