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
86aa5b10
Commit
86aa5b10
authored
Aug 12, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[power] Check device_suspend() return value in swsusp.
From Pavel Machek.
parent
cad2b8ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
kernel/power/swsusp.c
kernel/power/swsusp.c
+12
-8
No files found.
kernel/power/swsusp.c
View file @
86aa5b10
...
...
@@ -479,19 +479,23 @@ static void drivers_unsuspend(void)
/* Called from process context */
static
int
drivers_suspend
(
void
)
{
device_suspend
(
4
,
SUSPEND_NOTIFY
);
device_suspend
(
4
,
SUSPEND_SAVE_STATE
);
device_suspend
(
4
,
SUSPEND_DISABLE
);
if
(
!
pm_suspend_state
)
{
if
(
device_suspend
(
4
,
SUSPEND_NOTIFY
))
return
-
EIO
;
if
(
device_suspend
(
4
,
SUSPEND_SAVE_STATE
))
{
device_resume
(
RESUME_RESTORE_STATE
);
return
-
EIO
;
}
if
(
!
pm_suspend_state
)
{
if
(
pm_send_all
(
PM_SUSPEND
,(
void
*
)
3
))
{
printk
(
KERN_WARNING
"Problem while sending suspend event
\n
"
);
return
(
1
)
;
return
-
EIO
;
}
pm_suspend_state
=
1
;
}
else
printk
(
KERN_WARNING
"PM suspend state already raised
\n
"
);
device_suspend
(
4
,
SUSPEND_DISABLE
);
return
(
0
)
;
return
0
;
}
#define RESUME_PHASE1 1
/* Called from interrupts disabled */
...
...
@@ -504,7 +508,7 @@ static void drivers_resume(int flags)
device_resume
(
RESUME_ENABLE
);
}
if
(
flags
&
RESUME_PHASE2
)
{
if
(
pm_suspend_state
)
{
if
(
pm_suspend_state
)
{
if
(
pm_send_all
(
PM_RESUME
,(
void
*
)
0
))
printk
(
KERN_WARNING
"Problem while sending resume event
\n
"
);
pm_suspend_state
=
0
;
...
...
@@ -715,7 +719,7 @@ static void do_software_suspend(void)
blk_run_queues
();
/* Save state of all device drivers, and stop them. */
if
(
drivers_suspend
()
==
0
)
if
(
drivers_suspend
()
==
0
)
/* If stopping device drivers worked, we proceed basically into
* suspend_save_image.
*
...
...
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