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
f52c3034
Commit
f52c3034
authored
Sep 21, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Sep 21, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] gendisk for mcdx
mcdx switched to use of gendisk
parent
6606a03e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
drivers/cdrom/mcdx.c
drivers/cdrom/mcdx.c
+16
-1
No files found.
drivers/cdrom/mcdx.c
View file @
f52c3034
...
...
@@ -206,6 +206,7 @@ struct s_drive_stuff {
int
status
;
/* last operation's error / status */
int
readerrs
;
/* # of blocks read w/o error */
struct
cdrom_device_info
info
;
struct
gendisk
disk
;
};
...
...
@@ -1020,6 +1021,7 @@ void __exit mcdx_exit(void)
struct
s_drive_stuff
*
stuffp
=
mcdx_stuffp
[
i
];
if
(
!
stuffp
)
continue
;
del_gendisk
(
&
stuffp
->
disk
);
if
(
unregister_cdrom
(
&
stuffp
->
info
))
{
printk
(
KERN_WARNING
"Can't unregister cdrom mcdx
\n
"
);
return
;
...
...
@@ -1059,6 +1061,7 @@ module_exit(mcdx_exit);
int
__init
mcdx_init_drive
(
int
drive
)
{
struct
s_version
version
;
struct
gendisk
*
disk
;
struct
s_drive_stuff
*
stuffp
;
int
size
=
sizeof
(
*
stuffp
);
char
msg
[
80
];
...
...
@@ -1203,6 +1206,12 @@ int __init mcdx_init_drive(int drive)
stuffp
->
info
.
handle
=
stuffp
;
sprintf
(
stuffp
->
info
.
name
,
"mcdx%d"
,
drive
);
stuffp
->
info
.
dev
=
mk_kdev
(
MAJOR_NR
,
drive
);
disk
=
&
stuffp
->
disk
;
disk
->
major
=
MAJOR_NR
;
disk
->
first_minor
=
drive
;
disk
->
minor_shift
=
0
;
disk
->
major_name
=
stuffp
->
info
.
name
;
disk
->
fops
=
&
mcdx_bdops
;
sprintf
(
msg
,
" mcdx: Mitsumi CD-ROM installed at 0x%3p, irq %d."
" (Firmware version %c %x)
\n
"
,
...
...
@@ -1220,7 +1229,13 @@ int __init mcdx_init_drive(int drive)
blk_cleanup_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
));
return
2
;
}
devfs_plain_cdrom
(
&
stuffp
->
info
,
&
mcdx_bdops
);
devfs_plain_cdrom
(
&
stuffp
->
info
,
disk
->
fops
);
add_gendisk
(
disk
);
register_disk
(
disk
,
mk_kdev
(
disk
->
major
,
disk
->
first_minor
),
1
<<
disk
->
minor_shift
,
disk
->
fops
,
0
);
printk
(
msg
);
return
0
;
}
...
...
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