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
fe6ffad0
Commit
fe6ffad0
authored
Oct 17, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Oct 17, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sjcd.c
* switched to private queue * set ->queue * switched to new methods
parent
fb6bf18d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
18 deletions
+14
-18
drivers/cdrom/sjcd.c
drivers/cdrom/sjcd.c
+14
-18
No files found.
drivers/cdrom/sjcd.c
View file @
fe6ffad0
...
...
@@ -77,11 +77,12 @@
#include <asm/uaccess.h>
#define MAJOR_NR SANYO_CDROM_MAJOR
#define
DEVICE_NR(device) (minor(device)
)
#define
QUEUE (&sjcd_queue
)
#include <linux/blk.h>
#include "sjcd.h"
static
int
sjcd_present
=
0
;
static
struct
request_queue
sjcd_queue
;
#define SJCD_BUF_SIZ 32
/* cdr-h94a has internal 64K buffer */
...
...
@@ -453,15 +454,11 @@ static void sjcd_get_status(void)
/*
* Check the drive if the disk is changed. Should be revised.
*/
static
int
sjcd_disk_change
(
kdev_t
full_dev
)
static
int
sjcd_disk_change
(
struct
gendisk
*
disk
)
{
#if 0
printk("SJCD: sjcd_disk_change(
0x%x )\n", full_dev
);
printk("SJCD: sjcd_disk_change(
%s)\n", disk->disk_name
);
#endif
if
(
minor
(
full_dev
)
>
0
)
{
printk
(
"SJCD: request error: invalid device minor.
\n
"
);
return
0
;
}
if
(
!
sjcd_command_is_in_progress
)
sjcd_get_status
();
return
(
sjcd_status_valid
?
sjcd_media_is_changed
:
0
);
...
...
@@ -1067,7 +1064,6 @@ static void sjcd_invalidate_buffers(void)
static
int
current_valid
(
void
)
{
return
!
blk_queue_empty
(
QUEUE
)
&&
major
(
CURRENT
->
rq_dev
)
==
MAJOR_NR
&&
CURRENT
->
cmd
==
READ
&&
CURRENT
->
sector
!=
-
1
;
}
...
...
@@ -1645,11 +1641,11 @@ static int sjcd_release(struct inode *inode, struct file *file)
* A list of file operations allowed for this cdrom.
*/
static
struct
block_device_operations
sjcd_fops
=
{
.
owner
=
THIS_MODULE
,
.
open
=
sjcd_open
,
.
release
=
sjcd_release
,
.
ioctl
=
sjcd_ioctl
,
.
check_media_change
=
sjcd_disk_change
,
.
owner
=
THIS_MODULE
,
.
open
=
sjcd_open
,
.
release
=
sjcd_release
,
.
ioctl
=
sjcd_ioctl
,
.
media_changed
=
sjcd_disk_change
,
};
/*
...
...
@@ -1686,8 +1682,8 @@ static int __init sjcd_init(void)
return
(
-
EIO
);
}
blk_init_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
)
,
do_sjcd_request
,
&
sjcd_lock
);
blk_queue_hardsect_size
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
)
,
2048
);
blk_init_queue
(
&
sjcd_queue
,
do_sjcd_request
,
&
sjcd_lock
);
blk_queue_hardsect_size
(
&
sjcd_queue
,
2048
);
sjcd_disk
=
alloc_disk
(
1
);
if
(
!
sjcd_disk
)
{
...
...
@@ -1786,13 +1782,14 @@ static int __init sjcd_init(void)
printk
(
KERN_INFO
"SJCD: Status: port=0x%x.
\n
"
,
sjcd_base
);
devfs_register
(
NULL
,
"sjcd"
,
DEVFS_FL_DEFAULT
,
MAJOR_NR
,
0
,
S_IFBLK
|
S_IRUGO
|
S_IWUGO
,
&
sjcd_fops
,
NULL
);
sjcd_disk
->
queue
=
&
sjcd_queue
;
add_disk
(
sjcd_disk
);
sjcd_present
++
;
return
(
0
);
out3:
release_region
(
sjcd_base
,
4
);
blk_cleanup_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
)
);
blk_cleanup_queue
(
&
sjcd_queue
);
out2:
put_disk
(
sjcd_disk
);
out1:
...
...
@@ -1807,11 +1804,10 @@ static void __exit sjcd_exit(void)
del_gendisk
(
sjcd_disk
);
put_disk
(
sjcd_disk
);
release_region
(
sjcd_base
,
4
);
blk_cleanup_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
)
);
blk_cleanup_queue
(
&
sjcd_queue
);
if
((
unregister_blkdev
(
MAJOR_NR
,
"sjcd"
)
==
-
EINVAL
))
printk
(
"SJCD: cannot unregister device.
\n
"
);
printk
(
KERN_INFO
"SJCD: module: removed.
\n
"
);
return
(
0
);
}
module_init
(
sjcd_init
);
...
...
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