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
9c2ea509
Commit
9c2ea509
authored
Aug 21, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[power] Fix up sysfs state handling.
parent
ab2672c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
kernel/power/main.c
kernel/power/main.c
+9
-11
No files found.
kernel/power/main.c
View file @
9c2ea509
...
@@ -122,12 +122,9 @@ static int power_down(u32 mode)
...
@@ -122,12 +122,9 @@ static int power_down(u32 mode)
switch
(
mode
)
{
switch
(
mode
)
{
case
PM_DISK_PLATFORM
:
case
PM_DISK_PLATFORM
:
error
=
pm_ops
->
enter
(
PM_SUSPEND_DISK
);
error
=
pm_ops
->
enter
(
PM_SUSPEND_DISK
);
if
(
error
)
{
break
;
device_power_up
();
local_irq_restore
(
flags
);
return
error
;
}
case
PM_DISK_SHUTDOWN
:
case
PM_DISK_SHUTDOWN
:
printk
(
"Powering off system
\n
"
);
machine_power_off
();
machine_power_off
();
break
;
break
;
case
PM_DISK_REBOOT
:
case
PM_DISK_REBOOT
:
...
@@ -135,6 +132,8 @@ static int power_down(u32 mode)
...
@@ -135,6 +132,8 @@ static int power_down(u32 mode)
break
;
break
;
}
}
machine_halt
();
machine_halt
();
device_power_up
();
local_irq_restore
(
flags
);
return
0
;
return
0
;
}
}
...
@@ -304,7 +303,7 @@ static int enter_state(u32 state)
...
@@ -304,7 +303,7 @@ static int enter_state(u32 state)
goto
Unlock
;
goto
Unlock
;
}
}
pr_debug
(
"PM: Preparing system for suspend
.
\n
"
);
pr_debug
(
"PM: Preparing system for suspend
\n
"
);
if
((
error
=
suspend_prepare
(
state
)))
if
((
error
=
suspend_prepare
(
state
)))
goto
Unlock
;
goto
Unlock
;
...
@@ -493,16 +492,15 @@ static ssize_t state_show(struct subsystem * subsys, char * buf)
...
@@ -493,16 +492,15 @@ static ssize_t state_show(struct subsystem * subsys, char * buf)
static
ssize_t
state_store
(
struct
subsystem
*
subsys
,
const
char
*
buf
,
size_t
n
)
static
ssize_t
state_store
(
struct
subsystem
*
subsys
,
const
char
*
buf
,
size_t
n
)
{
{
u32
state
;
u32
state
=
PM_SUSPEND_STANDBY
;
struct
pm_state
*
s
;
struct
pm_state
*
s
;
int
error
;
int
error
;
for
(
state
=
0
;
state
<
PM_SUSPEND_MAX
;
state
++
)
{
for
(
s
=
&
pm_states
[
state
];
s
->
name
;
s
++
,
state
++
)
{
s
=
&
pm_states
[
state
];
if
(
!
strcmp
(
buf
,
s
->
name
))
if
(
s
->
name
&&
!
strcmp
(
buf
,
s
->
name
))
break
;
break
;
}
}
if
(
s
)
if
(
s
->
name
)
error
=
enter_state
(
state
);
error
=
enter_state
(
state
);
else
else
error
=
-
EINVAL
;
error
=
-
EINVAL
;
...
...
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