Commit 206ecfd8 authored by Kevin Hao's avatar Kevin Hao Committed by Zhang Kunbo
Browse files

cpufreq: Move to_gov_attr_set() to cpufreq.h

mainline inclusion
from mainline-v5.18-rc1
commit ae265086
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6N1

Reference: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=ae26508651272695a3ab353f75ab9a8daf3da324



--------------------------------

So it can be reused by other codes.

Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarZhang Kunbo <zhangkunbo@huawei.com>
parent 09e19251
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -11,11 +11,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);
+5 −0
Original line number Diff line number Diff line
@@ -551,6 +551,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);