patch-2.3.46 linux/drivers/cdrom/aztcd.c

Next file: linux/drivers/cdrom/cdrom.c
Previous file: linux/drivers/block/xd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.45/linux/drivers/cdrom/aztcd.c linux/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 @@
 #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 @@
                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 @@
 
 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;
     }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)