diff options
Diffstat (limited to 'drivers/cdrom')
-rw-r--r-- | drivers/cdrom/aztcd.c | 3 | ||||
-rw-r--r-- | drivers/cdrom/cdrom.c | 8 | ||||
-rw-r--r-- | drivers/cdrom/cdu31a.c | 3 | ||||
-rw-r--r-- | drivers/cdrom/cm206.c | 1 | ||||
-rw-r--r-- | drivers/cdrom/gscd.c | 19 | ||||
-rw-r--r-- | drivers/cdrom/gscd.h | 7 | ||||
-rw-r--r-- | drivers/cdrom/mcd.c | 22 | ||||
-rw-r--r-- | drivers/cdrom/mcd.h | 11 | ||||
-rw-r--r-- | drivers/cdrom/mcdx.c | 3 | ||||
-rw-r--r-- | drivers/cdrom/optcd.c | 3 | ||||
-rw-r--r-- | drivers/cdrom/sbpcd.c | 6 | ||||
-rw-r--r-- | drivers/cdrom/sjcd.c | 7 | ||||
-rw-r--r-- | drivers/cdrom/sonycd535.c | 9 |
13 files changed, 66 insertions, 36 deletions
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c index e32238d32..b3b73f2fc 100644 --- a/drivers/cdrom/aztcd.c +++ b/drivers/cdrom/aztcd.c @@ -1819,12 +1819,13 @@ int __init aztcd_init(void) void __exit aztcd_exit(void) { - devfs_unregister(devfs_find_handle(NULL, "aztcd", 0, 0, 0, DEVFS_SPECIAL_BLK, + devfs_unregister(devfs_find_handle(NULL, "aztcd", 0, 0, DEVFS_SPECIAL_BLK, 0)); if ((devfs_unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL)) { printk("What's that: can't unregister aztcd\n"); return; } + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); if ((azt_port==0x1f0)||(azt_port==0x170)) { SWITCH_IDE_MASTER; release_region(azt_port,8); /*IDE-interface*/ diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index caa3900b3..4503bbfed 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -389,7 +389,7 @@ int register_cdrom(struct cdrom_device_info *cdi) cdi->options |= (int) CDO_CHECK_TYPE; if (!devfs_handle) - devfs_handle = devfs_mk_dir (NULL, "cdroms", 6, NULL); + devfs_handle = devfs_mk_dir (NULL, "cdroms", NULL); sprintf (vname, "cdrom%u", cdrom_counter++); if (cdi->de) { int pos; @@ -400,9 +400,9 @@ int register_cdrom(struct cdrom_device_info *cdi) sizeof rname - 3); if (pos >= 0) { strncpy (rname + pos, "../", 3); - devfs_mk_symlink (devfs_handle, vname, 0, + devfs_mk_symlink (devfs_handle, vname, DEVFS_FL_DEFAULT, - rname + pos, 0, &slave, NULL); + rname + pos, &slave, NULL); devfs_auto_unregister (cdi->de, slave); } } @@ -2617,7 +2617,7 @@ static int __init cdrom_init(void) #ifdef CONFIG_SYSCTL cdrom_sysctl_register(); #endif - devfs_handle = devfs_mk_dir(NULL, "cdroms", 6, NULL); + devfs_handle = devfs_mk_dir(NULL, "cdroms", NULL); return 0; } diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c index 0b8d942b4..56054ae9e 100644 --- a/drivers/cdrom/cdu31a.c +++ b/drivers/cdrom/cdu31a.c @@ -3544,6 +3544,7 @@ cdu31a_init(void) } errout0: printk("Unable to register CDU-31a with Uniform cdrom driver\n"); + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); if (devfs_unregister_blkdev(MAJOR_NR, "cdu31a")) { printk("Can't unregister block device for cdu31a\n"); @@ -3569,6 +3570,8 @@ cdu31a_exit(void) return; } + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); + if (cdu31a_irq > 0) free_irq(cdu31a_irq, NULL); diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index 9e8889ac6..facf6223d 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c @@ -1285,6 +1285,7 @@ static void cleanup(int level) printk("Can't unregister major cm206\n"); return; } + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); case 3: free_irq(cm206_irq, NULL); case 2: diff --git a/drivers/cdrom/gscd.c b/drivers/cdrom/gscd.c index b0fa47b3e..dc8870491 100644 --- a/drivers/cdrom/gscd.c +++ b/drivers/cdrom/gscd.c @@ -95,7 +95,7 @@ static void gscd_bin2bcd (unsigned char *p); /* Schnittstellen zum Kern/FS */ static void do_gscd_request (request_queue_t *); -static void __do_gscd_request (void); +static void __do_gscd_request (unsigned long dummy); static int gscd_ioctl (struct inode *, struct file *, unsigned int, unsigned long); static int gscd_open (struct inode *, struct file *); static int gscd_release (struct inode *, struct file *); @@ -160,6 +160,7 @@ static int AudioStart_f; static int AudioEnd_m; static int AudioEnd_f; +static struct timer_list gscd_timer; static struct block_device_operations gscd_fops = { open: gscd_open, @@ -271,23 +272,24 @@ long offs; static void do_gscd_request (request_queue_t * q) { - __do_gscd_request(); + __do_gscd_request(0); } -static void __do_gscd_request (void) +static void __do_gscd_request (unsigned long dummy) { unsigned int block,dev; unsigned int nsect; repeat: - if (QUEUE_EMPTY || CURRENT->rq_status == RQ_INACTIVE) return; + if (QUEUE_EMPTY || CURRENT->rq_status == RQ_INACTIVE) + goto out; INIT_REQUEST; dev = MINOR(CURRENT->rq_dev); block = CURRENT->sector; nsect = CURRENT->nr_sectors; if (QUEUE_EMPTY || CURRENT -> sector == -1) - return; + goto out; if (CURRENT -> cmd != READ) { @@ -318,6 +320,8 @@ repeat: #endif gscd_read_cmd (); +out: + return; } @@ -992,13 +996,16 @@ long err; void __exit exit_gscd(void) { - devfs_unregister(devfs_find_handle(NULL, "gscd", 0, 0, 0, DEVFS_SPECIAL_BLK, + del_timer_async(&gscd_timer); + + devfs_unregister(devfs_find_handle(NULL, "gscd", 0, 0, DEVFS_SPECIAL_BLK, 0)); if ((devfs_unregister_blkdev(MAJOR_NR, "gscd" ) == -EINVAL)) { printk("What's that: can't unregister GoldStar-module\n" ); return; } + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); release_region (gscd_port,4); printk(KERN_INFO "GoldStar-module released.\n" ); } diff --git a/drivers/cdrom/gscd.h b/drivers/cdrom/gscd.h index fccc742a5..9c294762b 100644 --- a/drivers/cdrom/gscd.h +++ b/drivers/cdrom/gscd.h @@ -74,11 +74,10 @@ #define READ_DATA(port, buf, nr) insb(port, buf, nr) #define SET_TIMER(func, jifs) \ - ((timer_table[GSCD_TIMER].expires = jiffies + jifs), \ - (timer_table[GSCD_TIMER].fn = func), \ - (timer_active |= 1<<GSCD_TIMER)) + ((mod_timer(&gscd_timer, jiffies + jifs)), \ + (gscd_timer.function = func)) -#define CLEAR_TIMER timer_active &= ~(1<<GSCD_TIMER) +#define CLEAR_TIMER del_timer_sync(&gscd_timer) #define MAX_TRACKS 104 diff --git a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c index 91bde1a1d..0f59831b7 100644 --- a/drivers/cdrom/mcd.c +++ b/drivers/cdrom/mcd.c @@ -182,7 +182,7 @@ static char tocUpToDate; static char mcdVersion; static void mcd_transfer(void); -static void mcd_poll(void); +static void mcd_poll(unsigned long dummy); static void mcd_invalidate_buffers(void); static void hsg2msf(long hsg, struct msf *msf); static void bin2bcd(unsigned char *p); @@ -203,6 +203,8 @@ int mcd_audio_ioctl(struct cdrom_device_info * cdi, unsigned int cmd, void * arg); int mcd_drive_status(struct cdrom_device_info * cdi, int slot_nr); +static struct timer_list mcd_timer; + static struct cdrom_device_ops mcd_dops = { mcd_open, /* open */ mcd_release, /* release */ @@ -705,7 +707,7 @@ do_mcd_request(request_queue_t * q) static void -mcd_poll(void) +mcd_poll(unsigned long dummy) { int st; @@ -787,7 +789,7 @@ mcd_poll(void) #ifdef TEST3 printk("MCD_S_IDLE\n"); #endif - return; + goto out; @@ -829,7 +831,7 @@ mcd_poll(void) mcd_state = MCD_S_IDLE; while (CURRENT_VALID) end_request(0); - return; + goto out; } outb(MCMD_SET_MODE, MCDPORT(0)); @@ -869,7 +871,7 @@ mcd_poll(void) mcd_state = MCD_S_IDLE; while (CURRENT_VALID) end_request(0); - return; + goto out; } if (CURRENT_VALID) { @@ -1071,13 +1073,13 @@ mcd_poll(void) } } else { mcd_state = MCD_S_IDLE; - return; + goto out; } break; default: printk("mcd: invalid state %d\n", mcd_state); - return; + goto out; } ret: @@ -1087,6 +1089,8 @@ mcd_poll(void) } SET_TIMER(mcd_poll, 1); +out: + return; } @@ -1169,6 +1173,7 @@ static void cleanup(int level) printk(KERN_WARNING "Can't unregister major mcd\n"); return; } + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); default: } } @@ -1369,7 +1374,7 @@ sendMcdCmd(int cmd, struct mcd_Play_msf *params) */ static void -mcdStatTimer(void) +mcdStatTimer(unsigned long dummy) { if (!(inb(MCDPORT(1)) & MFL_STATUS)) { @@ -1659,6 +1664,7 @@ Toc[i].diskTime.min, Toc[i].diskTime.sec, Toc[i].diskTime.frame); void __exit mcd_exit(void) { cleanup(3); + del_timer_sync(&mcd_timer); } #ifdef MODULE diff --git a/drivers/cdrom/mcd.h b/drivers/cdrom/mcd.h index fffaa92a6..ce903d2f2 100644 --- a/drivers/cdrom/mcd.h +++ b/drivers/cdrom/mcd.h @@ -73,12 +73,13 @@ #define READ_DATA(port, buf, nr) \ insb(port, buf, nr) -#define SET_TIMER(func, jifs) \ - ((timer_table[MCD_TIMER].expires = jiffies + jifs), \ - (timer_table[MCD_TIMER].fn = func), \ - (timer_active |= 1<<MCD_TIMER)) +#define SET_TIMER(func, jifs) \ + do { \ + mcd_timer.function = func; \ + mod_timer(&mcd_timer, jiffies + jifs); \ + } while (0) -#define CLEAR_TIMER timer_active &= ~(1<<MCD_TIMER) +#define CLEAR_TIMER del_timer_async(&mcd_timer); #define MAX_TRACKS 104 diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index 805044841..574ee429e 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c @@ -1016,6 +1016,7 @@ void __exit mcdx_exit(void) if (devfs_unregister_blkdev(MAJOR_NR, "mcdx") != 0) { xwarn("cleanup() unregister_blkdev() failed\n"); } + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); #if !MCDX_QUIET else xinfo("cleanup() succeeded\n"); #endif @@ -1143,6 +1144,7 @@ int __init mcdx_init_drive(int drive) MCDX, stuffp->wreg_data, stuffp->irq, stuffp->irq); stuffp->irq = 0; + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); kfree(stuffp); return 0; } @@ -1184,6 +1186,7 @@ int __init mcdx_init_drive(int drive) kfree(stuffp); if (devfs_unregister_blkdev(MAJOR_NR, "mcdx") != 0) xwarn("cleanup() unregister_blkdev() failed\n"); + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); return 2; } printk(msg); diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c index 480a01833..f851cd074 100644 --- a/drivers/cdrom/optcd.c +++ b/drivers/cdrom/optcd.c @@ -2080,12 +2080,13 @@ int __init optcd_init(void) void __exit optcd_exit(void) { - devfs_unregister(devfs_find_handle(NULL, "optcd", 0, 0, 0, + devfs_unregister(devfs_find_handle(NULL, "optcd", 0, 0, DEVFS_SPECIAL_BLK, 0)); if (devfs_unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL) { printk(KERN_ERR "optcd: what's that: can't unregister\n"); return; } + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); release_region(optcd_port, 4); printk(KERN_INFO "optcd: module released.\n"); } diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 08400a52c..2f65bb525 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -5752,7 +5752,7 @@ int __init SBPCD_INIT(void) request_region(CDo_command,4,major_name); - devfs_handle = devfs_mk_dir (NULL, "sbp", 0, NULL); + devfs_handle = devfs_mk_dir (NULL, "sbp", NULL); for (j=0;j<NR_SBPCD;j++) { struct cdrom_device_info * sbpcd_infop; @@ -5779,6 +5779,7 @@ int __init SBPCD_INIT(void) printk("Can't unregister %s\n", major_name); } release_region(CDo_command,4); + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); return -EIO; } #ifdef MODULE @@ -5794,6 +5795,7 @@ int __init SBPCD_INIT(void) if (sbpcd_infop == NULL) { release_region(CDo_command,4); + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); return -ENOMEM; } D_S[j].sbpcd_infop = sbpcd_infop; @@ -5845,7 +5847,7 @@ void sbpcd_exit(void) return; } release_region(CDo_command,4); - + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); devfs_unregister (devfs_handle); for (j=0;j<NR_SBPCD;j++) { diff --git a/drivers/cdrom/sjcd.c b/drivers/cdrom/sjcd.c index a867c3819..b793bac4b 100644 --- a/drivers/cdrom/sjcd.c +++ b/drivers/cdrom/sjcd.c @@ -1577,8 +1577,10 @@ sjcd_cleanup(void) { if( (devfs_unregister_blkdev(MAJOR_NR, "sjcd") == -EINVAL) ) printk( "SJCD: cannot unregister device.\n" ); - else + else { release_region( sjcd_base, 4 ); + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); + } return(0); } @@ -1586,8 +1588,7 @@ sjcd_cleanup(void) void __exit sjcd_exit(void) { - devfs_unregister(devfs_find_handle(NULL, "sjcd", 0, 0, 0, DEVFS_SPECIAL_BLK, - 0)); + devfs_unregister(devfs_find_handle(NULL, "sjcd", 0, 0, DEVFS_SPECIAL_BLK,0)); if ( sjcd_cleanup() ) printk( "SJCD: module: cannot be removed.\n" ); else diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c index d85fbc01f..945facb97 100644 --- a/drivers/cdrom/sonycd535.c +++ b/drivers/cdrom/sonycd535.c @@ -1603,17 +1603,21 @@ sony535_init(void) sony_toc = (struct s535_sony_toc *) kmalloc(sizeof *sony_toc, GFP_KERNEL); - if (sony_toc == NULL) + if (sony_toc == NULL) { + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); return -ENOMEM; + } last_sony_subcode = (struct s535_sony_subcode *) kmalloc(sizeof *last_sony_subcode, GFP_KERNEL); if (last_sony_subcode == NULL) { + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); kfree(sony_toc); return -ENOMEM; } sony_buffer = (Byte **) kmalloc(4 * sony_buffer_sectors, GFP_KERNEL); if (sony_buffer == NULL) { + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); kfree(sony_toc); kfree(last_sony_subcode); return -ENOMEM; @@ -1624,6 +1628,7 @@ sony535_init(void) if (sony_buffer[i] == NULL) { while (--i>=0) kfree(sony_buffer[i]); + blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); kfree(sony_buffer); kfree(sony_toc); kfree(last_sony_subcode); @@ -1690,7 +1695,7 @@ sony535_exit(void) kfree_s(sony_buffer, 4 * sony_buffer_sectors); kfree_s(last_sony_subcode, sizeof *last_sony_subcode); kfree_s(sony_toc, sizeof *sony_toc); - devfs_unregister(devfs_find_handle(NULL, CDU535_HANDLE, 0, 0, 0, + devfs_unregister(devfs_find_handle(NULL, CDU535_HANDLE, 0, 0, DEVFS_SPECIAL_BLK, 0)); if (devfs_unregister_blkdev(MAJOR_NR, CDU535_HANDLE) == -EINVAL) printk("Uh oh, couldn't unregister " CDU535_HANDLE "\n"); |