summaryrefslogtreecommitdiffstats
path: root/drivers/cdrom/aztcd.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /drivers/cdrom/aztcd.c
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'drivers/cdrom/aztcd.c')
-rw-r--r--drivers/cdrom/aztcd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
index ef9cbd398..e7df93ac6 100644
--- a/drivers/cdrom/aztcd.c
+++ b/drivers/cdrom/aztcd.c
@@ -183,6 +183,7 @@
#include <linux/ioport.h>
#include <linux/string.h>
#include <linux/major.h>
+#include <linux/devfs_fs_kernel.h>
#ifndef AZT_KERNEL_PRIOR_2_1
#include <linux/init.h>
@@ -234,7 +235,7 @@ static int aztcd_blocksizes[1] = {2048};
#endif
#define CURRENT_VALID \
- (CURRENT && MAJOR(CURRENT -> rq_dev) == MAJOR_NR && CURRENT -> cmd == READ \
+ (!QUEUE_EMPTY && MAJOR(CURRENT -> rq_dev) == MAJOR_NR && CURRENT -> cmd == READ \
&& CURRENT -> sector != -1)
#define AFL_STATUSorDATA (AFL_STATUS | AFL_DATA)
@@ -1785,7 +1786,9 @@ int __init aztcd_init(void)
return -EIO;
}
}
- if (register_blkdev(MAJOR_NR, "aztcd", &azt_fops) != 0)
+ devfs_register (NULL, "aztcd", 0, DEVFS_FL_DEFAULT, MAJOR_NR, 0,
+ S_IFBLK | S_IRUGO | S_IWUGO, 0, 0, &azt_fops, NULL);
+ if (devfs_register_blkdev(MAJOR_NR, "aztcd", &azt_fops) != 0)
{
printk("aztcd: Unable to get major %d for Aztech CD-ROM\n",
MAJOR_NR);
@@ -1811,7 +1814,9 @@ int __init aztcd_init(void)
void __exit aztcd_exit(void)
{
- if ((unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL))
+ devfs_unregister(devfs_find_handle(NULL, "aztcd", 0, 0, 0, DEVFS_SPECIAL_BLK,
+ 0));
+ if ((devfs_unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL))
{ printk("What's that: can't unregister aztcd\n");
return;
}