patch-2.4.14 linux/drivers/cdrom/mcd.c

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

diff -u --recursive --new-file v2.4.13/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
@@ -189,6 +189,15 @@
 		    void *arg);
 int mcd_drive_status(struct cdrom_device_info *cdi, int slot_nr);
 
+struct block_device_operations mcd_bdops =
+{
+	owner:			THIS_MODULE,
+	open:			cdrom_open,
+	release:		cdrom_release,
+	ioctl:			cdrom_ioctl,
+	check_media_change:	cdrom_media_changed,
+};
+
 static struct timer_list mcd_timer;
 
 static struct cdrom_device_ops mcd_dops = {
@@ -978,8 +987,6 @@
 	if (mcdPresent == 0)
 		return -ENXIO;	/* no hardware */
 
-	MOD_INC_USE_COUNT;
-
 	if (mcd_open_count || mcd_state != MCD_S_IDLE)
 		goto bump_count;
 
@@ -1002,7 +1009,6 @@
 	return 0;
 
 err_out:
-	MOD_DEC_USE_COUNT;
 	return -EIO;
 }
 
@@ -1015,7 +1021,6 @@
 	if (!--mcd_open_count) {
 		mcd_invalidate_buffers();
 	}
-	MOD_DEC_USE_COUNT;
 }
 
 
@@ -1060,7 +1065,7 @@
 		return -EIO;
 	}
 
-	if (devfs_register_blkdev(MAJOR_NR, "mcd", &cdrom_fops) != 0) {
+	if (devfs_register_blkdev(MAJOR_NR, "mcd", &mcd_bdops) != 0) {
 		printk(KERN_ERR "mcd: Unable to get major %d for Mitsumi CD-ROM\n", MAJOR_NR);
 		return -EIO;
 	}
@@ -1152,6 +1157,7 @@
 		cleanup(3);
 		return -EIO;
 	}
+	devfs_plain_cdrom(&mcd_info, &mcd_bdops);
 	printk(msg);
 
 	return 0;

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