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
96776f3b
Commit
96776f3b
authored
Jul 24, 2008
by
Bartlomiej Zolnierkiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sc1200: convert to use ->host_priv
Signed-off-by:
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
parent
1d76d9dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
drivers/ide/pci/sc1200.c
drivers/ide/pci/sc1200.c
+19
-20
No files found.
drivers/ide/pci/sc1200.c
View file @
96776f3b
...
...
@@ -234,20 +234,10 @@ static int sc1200_suspend (struct pci_dev *dev, pm_message_t state)
* we only save state when going from full power to less
*/
if
(
state
.
event
==
PM_EVENT_ON
)
{
struct
sc1200_saved_state
*
ss
;
struct
ide_host
*
host
=
pci_get_drvdata
(
dev
);
struct
sc1200_saved_state
*
ss
=
host
->
host_priv
;
unsigned
int
r
;
/*
* allocate a permanent save area, if not already allocated
*/
ss
=
(
struct
sc1200_saved_state
*
)
pci_get_drvdata
(
dev
);
if
(
ss
==
NULL
)
{
ss
=
kmalloc
(
sizeof
(
*
ss
),
GFP_KERNEL
);
if
(
ss
==
NULL
)
return
-
ENOMEM
;
pci_set_drvdata
(
dev
,
ss
);
}
/*
* save timing registers
* (this may be unnecessary if BIOS also does it)
...
...
@@ -263,7 +253,8 @@ static int sc1200_suspend (struct pci_dev *dev, pm_message_t state)
static
int
sc1200_resume
(
struct
pci_dev
*
dev
)
{
struct
sc1200_saved_state
*
ss
;
struct
ide_host
*
host
=
pci_get_drvdata
(
dev
);
struct
sc1200_saved_state
*
ss
=
host
->
host_priv
;
unsigned
int
r
;
int
i
;
...
...
@@ -271,16 +262,12 @@ static int sc1200_resume (struct pci_dev *dev)
if
(
i
)
return
i
;
ss
=
(
struct
sc1200_saved_state
*
)
pci_get_drvdata
(
dev
);
/*
* restore timing registers
* (this may be unnecessary if BIOS also does it)
*/
if
(
ss
)
{
for
(
r
=
0
;
r
<
8
;
r
++
)
pci_write_config_dword
(
dev
,
0x40
+
r
*
4
,
ss
->
regs
[
r
]);
}
for
(
r
=
0
;
r
<
8
;
r
++
)
pci_write_config_dword
(
dev
,
0x40
+
r
*
4
,
ss
->
regs
[
r
]);
return
0
;
}
...
...
@@ -317,7 +304,19 @@ static const struct ide_port_info sc1200_chipset __devinitdata = {
static
int
__devinit
sc1200_init_one
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
return
ide_pci_init_one
(
dev
,
&
sc1200_chipset
,
NULL
);
struct
sc1200_saved_state
*
ss
=
NULL
;
int
rc
;
#ifdef CONFIG_PM
ss
=
kmalloc
(
sizeof
(
*
ss
),
GFP_KERNEL
);
if
(
ss
==
NULL
)
return
-
ENOMEM
;
#endif
rc
=
ide_pci_init_one
(
dev
,
&
sc1200_chipset
,
ss
);
if
(
rc
)
kfree
(
ss
);
return
rc
;
}
static
const
struct
pci_device_id
sc1200_pci_tbl
[]
=
{
...
...
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