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

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

diff -u --recursive --new-file v2.3.45/linux/drivers/cdrom/gscd.c linux/drivers/cdrom/gscd.c
@@ -63,6 +63,7 @@
 #include <linux/major.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/devfs_fs_kernel.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -279,13 +280,13 @@
 unsigned int nsect;
 
 repeat:
-	if (!(CURRENT) || CURRENT->rq_status == RQ_INACTIVE) return;
+	if (QUEUE_EMPTY || CURRENT->rq_status == RQ_INACTIVE) return;
 	INIT_REQUEST;
 	dev = MINOR(CURRENT->rq_dev);
 	block = CURRENT->sector;
 	nsect = CURRENT->nr_sectors;
 
-	if (CURRENT == NULL || CURRENT -> sector == -1)
+	if (QUEUE_EMPTY || CURRENT -> sector == -1)
 		return;
 
 	if (CURRENT -> cmd != READ)
@@ -991,12 +992,13 @@
 void __exit exit_gscd(void)
 {
 
-   if ((unregister_blkdev(MAJOR_NR, "gscd" ) == -EINVAL))
+   devfs_unregister(devfs_find_handle(NULL, "gscd", 0, 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;
    }
-
    release_region (gscd_port,4);
    printk(KERN_INFO "GoldStar-module released.\n" );
 }
@@ -1067,12 +1069,14 @@
            i++;
         }
 
-	if (register_blkdev(MAJOR_NR, "gscd", &gscd_fops) != 0)
+	if (devfs_register_blkdev(MAJOR_NR, "gscd", &gscd_fops) != 0)
 	{
 		printk("GSCD: Unable to get major %d for GoldStar CD-ROM\n",
 		       MAJOR_NR);
 		return -EIO;
 	}
+	devfs_register (NULL, "gscd", 0, DEVFS_FL_DEFAULT, MAJOR_NR, 0,
+			S_IFBLK | S_IRUGO | S_IWUGO, 0, 0, &gscd_fops, NULL);
 
 	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
 	blksize_size[MAJOR_NR] = gscd_blocksizes;

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