Skip to content

Commit

Permalink
cpufreq: Move to_gov_attr_set() to cpufreq.h
Browse files Browse the repository at this point in the history
commit ae26508 upstream.

So it can be reused by other codes.

Signed-off-by: Kevin Hao <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
haokexin authored and Sasha Levin committed Jan 30, 2023
1 parent 0fc15cf commit 4c85fe7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/cpufreq/cpufreq_governor_attr_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

#include "cpufreq_governor.h"

static inline struct gov_attr_set *to_gov_attr_set(struct kobject *kobj)
{
return container_of(kobj, struct gov_attr_set, kobj);
}

static inline struct governor_attr *to_gov_attr(struct attribute *attr)
{
return container_of(attr, struct governor_attr, attr);
Expand Down
5 changes: 5 additions & 0 deletions include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,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);
Expand Down

0 comments on commit 4c85fe7

Please sign in to comment.