patch-2.4.0-test3 linux/drivers/cdrom/mcd.c

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

diff -u --recursive --new-file v2.4.0-test2/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
@@ -182,7 +182,7 @@
 static char mcdVersion;
 
 static void mcd_transfer(void);
-static void mcd_poll(void);
+static void mcd_poll(unsigned long dummy);
 static void mcd_invalidate_buffers(void);
 static void hsg2msf(long hsg, struct msf *msf);
 static void bin2bcd(unsigned char *p);
@@ -203,6 +203,8 @@
                       void * arg);
 int mcd_drive_status(struct cdrom_device_info * cdi, int slot_nr);
 
+static struct timer_list mcd_timer;
+
 static struct cdrom_device_ops mcd_dops = {
   mcd_open,                   /* open */
   mcd_release,                /* release */
@@ -705,7 +707,7 @@
 
 
 static void
-mcd_poll(void)
+mcd_poll(unsigned long dummy)
 {
   int st;
 
@@ -787,7 +789,7 @@
 #ifdef TEST3
     printk("MCD_S_IDLE\n");
 #endif
-    return;
+    goto out;
 
 
 
@@ -829,7 +831,7 @@
 	mcd_state = MCD_S_IDLE;
 	while (CURRENT_VALID)
 	  end_request(0);
-	return;
+	goto out;
       }
 
       outb(MCMD_SET_MODE, MCDPORT(0));
@@ -869,7 +871,7 @@
 	mcd_state = MCD_S_IDLE;
 	while (CURRENT_VALID)
 	  end_request(0);
-	return;
+	goto out;
       }
 
       if (CURRENT_VALID) {
@@ -1071,13 +1073,13 @@
       }
     } else {
       mcd_state = MCD_S_IDLE;
-      return;
+      goto out;
     }
     break;
 
   default:
     printk("mcd: invalid state %d\n", mcd_state);
-    return;
+    goto out;
   }
 
  ret:
@@ -1087,6 +1089,8 @@
   }
 
   SET_TIMER(mcd_poll, 1);
+out:
+  return;
 }
 
 
@@ -1169,6 +1173,7 @@
       printk(KERN_WARNING "Can't unregister major mcd\n");
       return;
     }
+    blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
   default:
   }
 }
@@ -1369,7 +1374,7 @@
  */
 
 static void
-mcdStatTimer(void)
+mcdStatTimer(unsigned long dummy)
 {
 	if (!(inb(MCDPORT(1)) & MFL_STATUS))
 	{
@@ -1659,6 +1664,7 @@
 void __exit mcd_exit(void)
 {
   cleanup(3);
+  del_timer_sync(&mcd_timer);
 }
 
 #ifdef MODULE

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