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
c403e2b4
Commit
c403e2b4
authored
Jun 09, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[nmi] Convert to use new system device API.
parent
1a28d3fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
arch/i386/kernel/nmi.c
arch/i386/kernel/nmi.c
+16
-20
No files found.
arch/i386/kernel/nmi.c
View file @
c403e2b4
...
@@ -183,50 +183,46 @@ void enable_lapic_nmi_watchdog(void)
...
@@ -183,50 +183,46 @@ void enable_lapic_nmi_watchdog(void)
#include <linux/device.h>
#include <linux/device.h>
static
int
nmi_pm_active
;
/* nmi_active before suspend */
static
int
nmi_pm_active
;
/* nmi_active before suspend */
static
int
lapic_nmi_suspend
(
struct
device
*
dev
,
u32
state
,
u32
level
)
static
int
lapic_nmi_suspend
(
struct
sys_device
*
dev
,
u32
state
)
{
{
if
(
level
!=
SUSPEND_POWER_DOWN
)
return
0
;
nmi_pm_active
=
nmi_active
;
nmi_pm_active
=
nmi_active
;
disable_lapic_nmi_watchdog
();
disable_lapic_nmi_watchdog
();
return
0
;
return
0
;
}
}
static
int
lapic_nmi_resume
(
struct
device
*
dev
,
u32
level
)
static
int
lapic_nmi_resume
(
struct
sys_device
*
dev
)
{
{
if
(
level
!=
RESUME_POWER_ON
)
return
0
;
if
(
nmi_pm_active
>
0
)
if
(
nmi_pm_active
>
0
)
enable_lapic_nmi_watchdog
();
enable_lapic_nmi_watchdog
();
return
0
;
return
0
;
}
}
static
struct
device_driver
lapic_nmi_driver
=
{
.
name
=
"lapic_nmi"
,
static
struct
sysdev_class
nmi_sysclass
=
{
.
bus
=
&
system_bus_type
,
set_kset_name
(
"lapic_nmi"
)
,
.
resume
=
lapic_nmi_resume
,
.
resume
=
lapic_nmi_resume
,
.
suspend
=
lapic_nmi_suspend
,
.
suspend
=
lapic_nmi_suspend
,
};
};
static
struct
sys_device
device_lapic_nmi
=
{
static
struct
sys_device
device_lapic_nmi
=
{
.
name
=
"lapic_nmi"
,
.
id
=
0
,
.
id
=
0
,
.
dev
=
{
.
cls
=
&
nmi_sysclass
,
.
name
=
"lapic_nmi"
,
.
driver
=
&
lapic_nmi_driver
,
.
parent
=
&
device_lapic
.
dev
,
},
};
};
static
int
__init
init_lapic_nmi_
device
fs
(
void
)
static
int
__init
init_lapic_nmi_
sys
fs
(
void
)
{
{
int
error
;
if
(
nmi_active
==
0
)
if
(
nmi_active
==
0
)
return
0
;
return
0
;
driver_register
(
&
lapic_nmi_driver
);
return
sys_device_register
(
&
device_lapic_nmi
);
error
=
sysdev_class_register
(
&
nmi_sysclass
);
if
(
!
error
)
error
=
sys_device_register
(
&
device_lapic_nmi
);
return
error
;
}
}
/* must come after the local APIC's device_initcall() */
/* must come after the local APIC's device_initcall() */
late_initcall
(
init_lapic_nmi_
device
fs
);
late_initcall
(
init_lapic_nmi_
sys
fs
);
#endif
/* CONFIG_PM */
#endif
/* CONFIG_PM */
...
...
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