Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kevin Hao and committed by
Rafael J. Wysocki
ae265086 26291c54

+5 -5
-5
drivers/cpufreq/cpufreq_governor_attr_set.c
··· 8 8 9 9 #include "cpufreq_governor.h" 10 10 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 - 16 11 static inline struct governor_attr *to_gov_attr(struct attribute *attr) 17 12 { 18 13 return container_of(attr, struct governor_attr, attr);
+5
include/linux/cpufreq.h
··· 658 658 /* sysfs ops for cpufreq governors */ 659 659 extern const struct sysfs_ops governor_sysfs_ops; 660 660 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 + 661 666 void gov_attr_set_init(struct gov_attr_set *attr_set, struct list_head *list_node); 662 667 void gov_attr_set_get(struct gov_attr_set *attr_set, struct list_head *list_node); 663 668 unsigned int gov_attr_set_put(struct gov_attr_set *attr_set, struct list_head *list_node);