我想知道如何在我的driver / driver.c中访问name成员 这是来自include / linux / cpufreq.h的代码
struct cpufreq_governor {
char name[CPUFREQ_NAME_LEN];
int (*governor) (struct cpufreq_policy *policy,
unsigned int event);
ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
char *buf);
int (*store_setspeed) (struct cpufreq_policy *policy,
unsigned int freq);
unsigned int max_transition_latency; /* HW must be able to switch to
next freq faster than this value in nano secs or we
will fallback to performance governor */
struct list_head governor_list;
struct module *owner;
};
driver.c有一个依赖于活动调控器的函数。那么如何将它作为driver.c中的变量
答案 0 :(得分:0)
Cpufreq导出符号cpufreq_get_policy
,您可以使用该符号获取策略。 cpufreq_policy
有一名成员governor
。这就是你要找的东西。