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
nexedi
linux
Commits
fce72d4b
Commit
fce72d4b
authored
Jun 08, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpuid: fix hotplug cpu remove bug for class device.
Signed-off-by:
Greg Kroah-Hartman
<
greg@kroah.com
>
parent
e1372495
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
arch/i386/kernel/cpuid.c
arch/i386/kernel/cpuid.c
+12
-14
No files found.
arch/i386/kernel/cpuid.c
View file @
fce72d4b
...
...
@@ -158,35 +158,27 @@ static struct file_operations cpuid_fops = {
.
open
=
cpuid_open
,
};
static
void
cpuid_class_simple_device_remove
(
void
)
{
int
i
=
0
;
for_each_online_cpu
(
i
)
class_simple_device_remove
(
MKDEV
(
CPUID_MAJOR
,
i
));
return
;
}
static
int
cpuid_class_simple_device_add
(
int
i
)
{
int
err
=
0
;
struct
class_device
*
class_err
;
class_err
=
class_simple_device_add
(
cpuid_class
,
MKDEV
(
CPUID_MAJOR
,
i
),
NULL
,
"cpu%d"
,
i
);
if
(
IS_ERR
(
class_err
))
{
if
(
IS_ERR
(
class_err
))
err
=
PTR_ERR
(
class_err
);
}
return
err
;
}
static
int
__devinit
cpuid_class_cpu_callback
(
struct
notifier_block
*
nfb
,
unsigned
long
action
,
void
*
hcpu
)
{
unsigned
int
cpu
=
(
unsigned
long
)
hcpu
;
switch
(
action
)
{
switch
(
action
)
{
case
CPU_ONLINE
:
cpuid_class_simple_device_add
(
cpu
);
break
;
case
CPU_DEAD
:
c
puid_class_simple_device_remove
(
);
c
lass_simple_device_remove
(
MKDEV
(
CPUID_MAJOR
,
cpu
)
);
break
;
}
return
NOTIFY_OK
;
...
...
@@ -224,7 +216,10 @@ int __init cpuid_init(void)
goto
out
;
out_class:
cpuid_class_simple_device_remove
();
i
=
0
;
for_each_online_cpu
(
i
)
{
class_simple_device_remove
(
MKDEV
(
CPUID_MAJOR
,
i
));
}
class_simple_destroy
(
cpuid_class
);
out_chrdev:
unregister_chrdev
(
CPUID_MAJOR
,
"cpu/cpuid"
);
...
...
@@ -234,7 +229,10 @@ int __init cpuid_init(void)
void
__exit
cpuid_exit
(
void
)
{
cpuid_class_simple_device_remove
();
int
cpu
=
0
;
for_each_online_cpu
(
cpu
)
class_simple_device_remove
(
MKDEV
(
CPUID_MAJOR
,
cpu
));
class_simple_destroy
(
cpuid_class
);
unregister_chrdev
(
CPUID_MAJOR
,
"cpu/cpuid"
);
unregister_cpu_notifier
(
&
cpuid_class_cpu_notifier
);
...
...
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