diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-10-17 19:36:16 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-17 19:36:16 -0700 |
| commit | 61320eebb2df5c1dd25eb9295c427a551ef9bfb2 (patch) | |
| tree | 4912d047d31e880917cc3a426ff9a632bf85a542 | |
| parent | bee3b2c53d662a85eb2f63597553ae39edd032bb (diff) | |
[PATCH] aztcd.c
* switched to private queue
* set ->queue
* switched to new methods
| -rw-r--r-- | drivers/cdrom/aztcd.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c index b8e1880d8714..93745b274cee 100644 --- a/drivers/cdrom/aztcd.c +++ b/drivers/cdrom/aztcd.c @@ -168,8 +168,7 @@ #include <linux/version.h> #define MAJOR_NR AZTECH_CDROM_MAJOR -#define DEVICE_NR(device) (minor(device)) - +#define QUEUE (&azt_queue) #include <linux/blk.h> #include "aztcd.h" @@ -227,10 +226,11 @@ #define AZT_DEBUG_MULTISESSION #endif +static struct request_queue azt_queue; + static int current_valid(void) { return !blk_queue_empty(QUEUE) && - major(CURRENT->rq_dev) == MAJOR_NR && CURRENT->cmd == READ && CURRENT->sector != -1; } @@ -329,18 +329,18 @@ static int aztGetMultiDiskInfo(void); static int aztGetToc(int multi); /* Kernel Interface Functions */ -static int check_aztcd_media_change(kdev_t full_dev); +static int check_aztcd_media_change(struct gendisk *disk); static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg); static int aztcd_open(struct inode *ip, struct file *fp); static int aztcd_release(struct inode *inode, struct file *file); static struct block_device_operations azt_fops = { - .owner = THIS_MODULE, - .open = aztcd_open, - .release = aztcd_release, - .ioctl = aztcd_ioctl, - .check_media_change = check_aztcd_media_change, + .owner = THIS_MODULE, + .open = aztcd_open, + .release = aztcd_release, + .ioctl = aztcd_ioctl, + .media_changed = check_aztcd_media_change, }; /* Aztcd State Machine: Controls Drive Operating State */ @@ -790,7 +790,7 @@ static int aztGetQChannelInfo(struct azt_Toc *qp) /* * Read the table of contents (TOC) and TOC header if necessary */ -static int aztUpdateToc() +static int aztUpdateToc(void) { int st; @@ -1141,7 +1141,7 @@ __setup("aztcd=", aztcd_setup); /* * Checking if the media has been changed */ -static int check_aztcd_media_change(kdev_t full_dev) +static int check_aztcd_media_change(struct gendisk *disk) { if (aztDiskChanged) { /* disk changed */ aztDiskChanged = 0; @@ -1677,8 +1677,8 @@ static int aztcd_release(struct inode *inode, struct file *file) { #ifdef AZT_DEBUG printk("aztcd: executing aztcd_release\n"); - printk("inode: %p, inode->i_rdev: %x file: %p\n", inode, - inode->i_rdev, file); + printk("inode: %p, device: %s file: %p\n", inode, + inode->i_bdev->bd_disk->disk_name, file); #endif if (!--azt_open_count) { azt_invalidate_buffers(); @@ -1917,12 +1917,13 @@ static int __init aztcd_init(void) ret = -EIO; goto err_out3; } - blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), do_aztcd_request, &aztSpin); - blk_queue_hardsect_size(BLK_DEFAULT_QUEUE(MAJOR_NR), 2048); + blk_init_queue(&azt_queue, do_aztcd_request, &aztSpin); + blk_queue_hardsect_size(&azt_queue, 2048); azt_disk->major = MAJOR_NR; azt_disk->first_minor = 0; azt_disk->fops = &azt_fops; sprintf(azt_disk->disk_name, "aztcd"); + azt_disk->queue = &azt_queue; add_disk(azt_disk); azt_invalidate_buffers(); @@ -1952,7 +1953,7 @@ static void __exit aztcd_exit(void) printk("What's that: can't unregister aztcd\n"); return; } - blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR)); + blk_cleanup_queue(&azt_queue); if ((azt_port == 0x1f0) || (azt_port == 0x170)) { SWITCH_IDE_MASTER; release_region(azt_port, 8); /*IDE-interface */ |
