summaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-16 01:07:24 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-16 01:07:24 +0000
commit95db6b748fc86297827fbd9c9ef174d491c9ad89 (patch)
tree27a92a942821cde1edda9a1b088718d436b3efe4 /drivers/cdrom
parent45b27b0a0652331d104c953a5b192d843fff88f8 (diff)
Merge with Linux 2.3.40.
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/aztcd.c3
-rw-r--r--drivers/cdrom/cdrom.c8
-rw-r--r--drivers/cdrom/gscd.c3
-rw-r--r--drivers/cdrom/optcd.c3
-rw-r--r--drivers/cdrom/sjcd.c3
-rw-r--r--drivers/cdrom/sonycd535.c6
6 files changed, 8 insertions, 18 deletions
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
index c9bc3f999..ef9cbd398 100644
--- a/drivers/cdrom/aztcd.c
+++ b/drivers/cdrom/aztcd.c
@@ -1593,8 +1593,6 @@ static int aztcd_release(struct inode * inode, struct file * file)
MOD_DEC_USE_COUNT;
if (!--azt_open_count) {
azt_invalidate_buffers();
- sync_dev(inode->i_rdev); /*??? isn't it a read only dev?*/
- invalidate_buffers(inode -> i_rdev);
aztUnlockDoor();
if (azt_auto_eject)
aztSendCmd(ACMD_EJECT);
@@ -1798,6 +1796,7 @@ int __init aztcd_init(void)
blksize_size[MAJOR_NR] = aztcd_blocksizes;
#endif
read_ahead[MAJOR_NR] = 4;
+ register_disk(NULL, MKDEV(MAJOR_NR,0), 1, &azt_fops, 0);
if ((azt_port==0x1f0)||(azt_port==0x170))
request_region(azt_port, 8, "aztcd"); /*IDE-interface*/
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index e7585203d..f7d15edad 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -353,6 +353,8 @@ int register_cdrom(struct cdrom_device_info *cdi)
cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name);
cdi->next = topCdromPtr;
topCdromPtr = cdi;
+ /*FIXME:as soon as we'll switch to real thing, pass device number here*/
+ register_disk(NULL, cdi->dev, 1, &cdrom_fops, 0);
return 0;
}
#undef ENSURE
@@ -380,6 +382,7 @@ int unregister_cdrom(struct cdrom_device_info *unreg)
prev->next = cdi->next;
else
topCdromPtr = cdi->next;
+/* unregister_disk(); */
cdi->ops->n_minors--;
cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" unregistered\n", cdi->name);
return 0;
@@ -640,11 +643,6 @@ int cdrom_release(struct inode *ip, struct file *fp)
!(fp && fp->f_flags & O_NONBLOCK);
cdo->release(cdi);
if (cdi->use_count == 0) { /* last process that closes dev*/
- struct super_block *sb;
- sync_dev(dev);
- sb = get_super(dev);
- if (sb) invalidate_inodes(sb);
- invalidate_buffers(dev);
if (opened_for_data &&
cdi->options & CDO_AUTO_EJECT && CDROM_CAN(CDC_OPEN_TRAY))
cdo->tray_move(cdi, 1);
diff --git a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c
index 73c6c950c..6047df0c7 100644
--- a/drivers/cdrom/gscd.c
+++ b/drivers/cdrom/gscd.c
@@ -418,8 +418,6 @@ printk ( "GSCD: release\n" );
#endif
gscd_bn = -1;
- sync_dev(inode->i_rdev);
- invalidate_buffers(inode -> i_rdev);
MOD_DEC_USE_COUNT;
return 0;
@@ -1084,6 +1082,7 @@ int result;
gscdPresent = 1;
request_region(gscd_port, 4, "gscd");
+ register_disk(NULL, MKDEV(MAJOR_NR,0), 1, &gscd_fops, 0);
printk (KERN_INFO "GSCD: GoldStar CD-ROM Drive found.\n" );
return 0;
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index f8ebde15d..b0bdc833a 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -1935,8 +1935,6 @@ static int opt_release(struct inode *ip, struct file *fp)
if (!--open_count) {
toc_uptodate = 0;
opt_invalidate_buffers();
- sync_dev(ip -> i_rdev);
- invalidate_buffers(ip -> i_rdev);
status = exec_cmd(COMUNLOCK); /* Unlock door */
if (status < 0) {
DEBUG((DEBUG_VFS, "exec_cmd COMUNLOCK: %02x", -status));
@@ -2074,6 +2072,7 @@ int __init optcd_init(void)
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[MAJOR_NR] = 4;
request_region(optcd_port, 4, "optcd");
+ register_disk(NULL, MKDEV(MAJOR_NR,0), 1, &opt_fops, 0);
printk(KERN_INFO "optcd: DOLPHIN 8000 AT CDROM at 0x%x\n", optcd_port);
return 0;
diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c
index 7ea184b5f..f13deeac8 100644
--- a/drivers/cdrom/sjcd.c
+++ b/drivers/cdrom/sjcd.c
@@ -1413,8 +1413,6 @@ static int sjcd_release( struct inode *inode, struct file *file ){
#endif
if( --sjcd_open_count == 0 ){
sjcd_invalidate_buffers();
- sync_dev( inode->i_rdev );
- invalidate_buffers( inode->i_rdev );
s = sjcd_tray_unlock();
if( s < 0 || !sjcd_status_valid || sjcd_command_failed ){
#if defined( SJCD_DIAGNOSTIC )
@@ -1480,6 +1478,7 @@ int __init sjcd_init( void ){
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
read_ahead[ MAJOR_NR ] = 4;
+ register_disk(NULL, MKDEV(MAJOR_NR,0), 1, &sjcd_fops, 0);
if( check_region( sjcd_base, 4 ) ){
printk( "SJCD: Init failed, I/O port (%X) is already in use\n",
diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c
index 14e25f90a..a9b82571e 100644
--- a/drivers/cdrom/sonycd535.c
+++ b/drivers/cdrom/sonycd535.c
@@ -798,9 +798,6 @@ do_cdu535_request(request_queue_t * q)
Byte status[2];
Byte cmd[2];
- if (!sony_inuse) {
- cdu_open(NULL, NULL);
- }
while (1) {
/*
* The beginning here is stolen from the hard disk driver. I hope
@@ -1396,7 +1393,6 @@ cdu_open(struct inode *inode,
{
Byte status[2], cmd_buff[2];
-
if (sony_inuse)
return -EBUSY;
if (check_drive_status() != 0)
@@ -1451,7 +1447,6 @@ cdu_release(struct inode *inode,
sony_usage--;
}
if (sony_usage == 0) {
- sync_dev(inode->i_rdev);
check_drive_status();
if (sony_audio_status != CDROM_AUDIO_PLAY) {
@@ -1639,6 +1634,7 @@ sony535_init(void)
return -EIO;
}
request_region(sony535_cd_base_io, 4, CDU535_HANDLE);
+ register_disk(NULL, MKDEV(MAJOR_NR,0), 1, &cdu_fops, 0);
return 0;
}