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
67d70567
Commit
67d70567
authored
Jun 14, 2002
by
William Stinson
Committed by
Jeff Garzik
Jun 14, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[janitor] request_region cleanups for mcd and mcdx ancient cd-rom drivers
parent
27b3f72f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
drivers/cdrom/mcd.c
drivers/cdrom/mcd.c
+5
-7
drivers/cdrom/mcdx.c
drivers/cdrom/mcdx.c
+10
-3
No files found.
drivers/cdrom/mcd.c
View file @
67d70567
...
...
@@ -1069,7 +1069,7 @@ int __init mcd_init(void)
printk
(
KERN_ERR
"mcd: Unable to get major %d for Mitsumi CD-ROM
\n
"
,
MAJOR_NR
);
return
-
EIO
;
}
if
(
check_region
(
mcd_port
,
4
))
{
if
(
!
request_region
(
mcd_port
,
4
,
"mcd"
))
{
cleanup
(
1
);
printk
(
KERN_ERR
"mcd: Initialization failed, I/O port (%X) already in use
\n
"
,
mcd_port
);
return
-
EIO
;
...
...
@@ -1092,7 +1092,7 @@ int __init mcd_init(void)
if
(
count
>=
2000000
)
{
printk
(
KERN_INFO
"mcd: initialisation failed - No mcd device at 0x%x irq %d
\n
"
,
mcd_port
,
mcd_irq
);
cleanup
(
1
);
cleanup
(
2
);
return
-
EIO
;
}
count
=
inb
(
MCDPORT
(
0
));
/* pick up the status */
...
...
@@ -1102,12 +1102,12 @@ int __init mcd_init(void)
if
(
getValue
(
result
+
count
))
{
printk
(
KERN_ERR
"mcd: mitsumi get version failed at 0x%x
\n
"
,
mcd_port
);
cleanup
(
1
);
cleanup
(
2
);
return
-
EIO
;
}
if
(
result
[
0
]
==
result
[
1
]
&&
result
[
1
]
==
result
[
2
])
{
cleanup
(
1
);
cleanup
(
2
);
return
-
EIO
;
}
...
...
@@ -1120,7 +1120,7 @@ int __init mcd_init(void)
if
(
request_irq
(
mcd_irq
,
mcd_interrupt
,
SA_INTERRUPT
,
"Mitsumi CD"
,
NULL
))
{
printk
(
KERN_ERR
"mcd: Unable to get IRQ%d for Mitsumi CD-ROM
\n
"
,
mcd_irq
);
cleanup
(
1
);
cleanup
(
2
);
return
-
EIO
;
}
...
...
@@ -1134,8 +1134,6 @@ int __init mcd_init(void)
" irq=%d
\n
"
,
mcd_info
.
speed
==
1
?
"Single"
:
"Double"
,
mcd_port
,
mcd_irq
);
request_region
(
mcd_port
,
4
,
"mcd"
);
outb
(
MCMD_CONFIG_DRIVE
,
MCDPORT
(
0
));
outb
(
0x02
,
MCDPORT
(
0
));
outb
(
0x00
,
MCDPORT
(
0
));
...
...
drivers/cdrom/mcdx.c
View file @
67d70567
...
...
@@ -1105,7 +1105,8 @@ int __init mcdx_init_drive(int drive)
init_waitqueue_head
(
&
stuffp
->
sleepq
);
/* check if i/o addresses are available */
if
(
check_region
((
unsigned
int
)
stuffp
->
wreg_data
,
MCDX_IO_SIZE
))
{
if
(
!
request_region
((
unsigned
int
)
stuffp
->
wreg_data
,
MCDX_IO_SIZE
,
"mcdx"
))
{
xwarn
(
"0x%3p,%d: Init failed. "
"I/O ports (0x%3p..0x%3p) already in use.
\n
"
,
stuffp
->
wreg_data
,
stuffp
->
irq
,
...
...
@@ -1125,6 +1126,8 @@ int __init mcdx_init_drive(int drive)
xtrace
(
INIT
,
"init() get version
\n
"
);
if
(
-
1
==
mcdx_requestversion
(
stuffp
,
&
version
,
4
))
{
/* failed, next drive */
release_region
((
unsigned
long
)
stuffp
->
wreg_data
,
MCDX_IO_SIZE
);
xwarn
(
"%s=0x%3p,%d: Init failed. Can't get version.
\n
"
,
MCDX
,
stuffp
->
wreg_data
,
stuffp
->
irq
);
xtrace
(
MALLOC
,
"init() free stuffp @ %p
\n
"
,
stuffp
);
...
...
@@ -1154,6 +1157,8 @@ int __init mcdx_init_drive(int drive)
stuffp
->
playcmd
=
READ1X
;
if
(
!
stuffp
->
present
)
{
release_region
((
unsigned
long
)
stuffp
->
wreg_data
,
MCDX_IO_SIZE
);
xwarn
(
"%s=0x%3p,%d: Init failed. No Mitsumi CD-ROM?.
\n
"
,
MCDX
,
stuffp
->
wreg_data
,
stuffp
->
irq
);
kfree
(
stuffp
);
...
...
@@ -1162,6 +1167,8 @@ int __init mcdx_init_drive(int drive)
xtrace
(
INIT
,
"init() register blkdev
\n
"
);
if
(
devfs_register_blkdev
(
MAJOR_NR
,
"mcdx"
,
&
mcdx_bdops
)
!=
0
)
{
release_region
((
unsigned
long
)
stuffp
->
wreg_data
,
MCDX_IO_SIZE
);
xwarn
(
"%s=0x%3p,%d: Init failed. Can't get major %d.
\n
"
,
MCDX
,
stuffp
->
wreg_data
,
stuffp
->
irq
,
MAJOR_NR
);
kfree
(
stuffp
);
...
...
@@ -1174,6 +1181,8 @@ int __init mcdx_init_drive(int drive)
xtrace
(
INIT
,
"init() subscribe irq and i/o
\n
"
);
mcdx_irq_map
[
stuffp
->
irq
]
=
stuffp
;
if
(
request_irq
(
stuffp
->
irq
,
mcdx_intr
,
SA_INTERRUPT
,
"mcdx"
,
NULL
))
{
release_region
((
unsigned
long
)
stuffp
->
wreg_data
,
MCDX_IO_SIZE
);
xwarn
(
"%s=0x%3p,%d: Init failed. Can't get irq (%d).
\n
"
,
MCDX
,
stuffp
->
wreg_data
,
stuffp
->
irq
,
stuffp
->
irq
);
stuffp
->
irq
=
0
;
...
...
@@ -1181,8 +1190,6 @@ int __init mcdx_init_drive(int drive)
kfree
(
stuffp
);
return
0
;
}
request_region
((
unsigned
int
)
stuffp
->
wreg_data
,
MCDX_IO_SIZE
,
"mcdx"
);
xtrace
(
INIT
,
"init() get garbage
\n
"
);
{
...
...
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