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
7a92cebe
Commit
7a92cebe
authored
Sep 27, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert system suspend states to proper PCI device states.
parent
ce640f19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
drivers/pci/pci-driver.c
drivers/pci/pci-driver.c
+14
-1
No files found.
drivers/pci/pci-driver.c
View file @
7a92cebe
...
@@ -299,10 +299,23 @@ static int pci_device_suspend(struct device * dev, u32 state)
...
@@ -299,10 +299,23 @@ static int pci_device_suspend(struct device * dev, u32 state)
{
{
struct
pci_dev
*
pci_dev
=
to_pci_dev
(
dev
);
struct
pci_dev
*
pci_dev
=
to_pci_dev
(
dev
);
struct
pci_driver
*
drv
=
pci_dev
->
driver
;
struct
pci_driver
*
drv
=
pci_dev
->
driver
;
u32
dev_state
;
int
i
=
0
;
int
i
=
0
;
/* Translate PM_SUSPEND_xx states to PCI device states */
static
u32
state_conversion
[]
=
{
[
PM_SUSPEND_ON
]
=
0
,
[
PM_SUSPEND_STANDBY
]
=
1
,
[
PM_SUSPEND_MEM
]
=
3
,
[
PM_SUSPEND_DISK
]
=
3
,
};
if
(
state
>=
sizeof
(
state_conversion
)
/
sizeof
(
state_conversion
[
1
]))
return
-
EINVAL
;
dev_state
=
state_conversion
[
state
];
if
(
drv
&&
drv
->
suspend
)
if
(
drv
&&
drv
->
suspend
)
i
=
drv
->
suspend
(
pci_dev
,
state
);
i
=
drv
->
suspend
(
pci_dev
,
dev_
state
);
pci_save_state
(
pci_dev
,
pci_dev
->
saved_config_space
);
pci_save_state
(
pci_dev
,
pci_dev
->
saved_config_space
);
return
i
;
return
i
;
...
...
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