Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
19d6f7ec
Commit
19d6f7ec
authored
Jul 08, 2009
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] Factor out symlink creation from cpufreq_add_dev
Signed-off-by:
Dave Jones
<
davej@redhat.com
>
parent
059019a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq.c
+31
-20
No files found.
drivers/cpufreq/cpufreq.c
View file @
19d6f7ec
...
...
@@ -756,6 +756,34 @@ static struct kobj_type ktype_cpufreq = {
.
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
...
...
@@ -929,26 +957,9 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
}
spin_unlock_irqrestore
(
&
cpufreq_driver_lock
,
flags
);
/* symlink affected CPUs */
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
);
goto
err_out_unregister
;
}
}
ret
=
cpufreq_add_dev_symlink
(
cpu
,
policy
->
cpus
,
policy
);
if
(
ret
)
goto
err_out_unregister
;
policy
->
governor
=
NULL
;
/* to assure that the starting sequence is
* run in cpufreq_set_policy */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment