Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
19d6f7ec
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
19d6f7ec
编写于
7月 08, 2009
作者:
D
Dave Jones
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CPUFREQ] Factor out symlink creation from cpufreq_add_dev
Signed-off-by:
N
Dave Jones
<
davej@redhat.com
>
上级
059019a3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
20 deletion
+31
-20
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq.c
+31
-20
未找到文件。
drivers/cpufreq/cpufreq.c
浏览文件 @
19d6f7ec
...
@@ -756,6 +756,34 @@ static struct kobj_type ktype_cpufreq = {
...
@@ -756,6 +756,34 @@ static struct kobj_type ktype_cpufreq = {
.
release
=
cpufreq_sysfs_release
,
.
release
=
cpufreq_sysfs_release
,
};
};
/* symlink affected CPUs */
int
cpufreq_add_dev_symlink
(
unsigned
int
cpu
,
struct
cpufreq_policy
*
policy
)
{
unsigned
int
j
;
int
ret
=
0
;
for_each_cpu
(
j
,
policy
->
cpus
)
{
struct
cpufreq_policy
*
managed_policy
;
struct
sys_device
*
cpu_sys_dev
;
if
(
j
==
cpu
)
continue
;
if
(
!
cpu_online
(
j
))
continue
;
dprintk
(
"CPU %u already managed, adding link
\n
"
,
j
);
managed_policy
=
cpufreq_cpu_get
(
cpu
);
cpu_sys_dev
=
get_cpu_sysdev
(
j
);
ret
=
sysfs_create_link
(
&
cpu_sys_dev
->
kobj
,
&
policy
->
kobj
,
"cpufreq"
);
if
(
ret
)
{
cpufreq_cpu_put
(
managed_policy
);
return
ret
;
}
}
return
ret
;
}
/**
/**
* cpufreq_add_dev - add a CPU device
* cpufreq_add_dev - add a CPU device
...
@@ -929,26 +957,9 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
...
@@ -929,26 +957,9 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
}
}
spin_unlock_irqrestore
(
&
cpufreq_driver_lock
,
flags
);
spin_unlock_irqrestore
(
&
cpufreq_driver_lock
,
flags
);
/* symlink affected CPUs */
ret
=
cpufreq_add_dev_symlink
(
cpu
,
policy
->
cpus
,
policy
);
for_each_cpu
(
j
,
policy
->
cpus
)
{
if
(
ret
)
struct
cpufreq_policy
*
managed_policy
;
goto
err_out_unregister
;
struct
sys_device
*
cpu_sys_dev
;
if
(
j
==
cpu
)
continue
;
if
(
!
cpu_online
(
j
))
continue
;
dprintk
(
"CPU %u already managed, adding link
\n
"
,
j
);
managed_policy
=
cpufreq_cpu_get
(
cpu
);
cpu_sys_dev
=
get_cpu_sysdev
(
j
);
ret
=
sysfs_create_link
(
&
cpu_sys_dev
->
kobj
,
&
policy
->
kobj
,
"cpufreq"
);
if
(
ret
)
{
cpufreq_cpu_put
(
managed_policy
);
goto
err_out_unregister
;
}
}
policy
->
governor
=
NULL
;
/* to assure that the starting sequence is
policy
->
governor
=
NULL
;
/* to assure that the starting sequence is
* run in cpufreq_set_policy */
* run in cpufreq_set_policy */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录