patch-2.3.46 linux/drivers/block/ps2esdi.c

Next file: linux/drivers/block/rd.c
Previous file: linux/drivers/block/paride/pt.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.45/linux/drivers/block/ps2esdi.c linux/drivers/block/ps2esdi.c
@@ -41,6 +41,7 @@
 #include <linux/kernel.h>
 #include <linux/genhd.h>
 #include <linux/ps2esdi.h>
+#include <linux/devfs_fs_kernel.h>
 #include <linux/blk.h>
 #include <linux/blkpg.h>
 #include <linux/mca.h>
@@ -164,7 +165,8 @@
 	ps2esdi_sizes,		/* block sizes */
 	0,			/* number */
 	(void *) ps2esdi_info,	/* internal */
-	NULL			/* next */
+	NULL,			/* next */
+	&ps2esdi_fops,          /* file operations */
 };
 
 /* initialization routine called by ll_rw_blk.c   */
@@ -173,7 +175,7 @@
 
 	/* register the device - pass the name, major number and operations
 	   vector .                                                 */
-	if (register_blkdev(MAJOR_NR, "ed", &ps2esdi_fops)) {
+	if (devfs_register_blkdev(MAJOR_NR, "ed", &ps2esdi_fops)) {
 		printk("%s: Unable to get major number %d\n", DEVICE_NAME, MAJOR_NR);
 		return -1;
 	}
@@ -229,7 +231,7 @@
 	release_region(io_base, 4);
 	free_dma(dma_arb_level);
   	free_irq(PS2ESDI_IRQ, NULL)
-	unregister_blkdev(MAJOR_NR, "ed");
+	devfs_unregister_blkdev(MAJOR_NR, "ed");
 }
 #endif /* MODULE */
 
@@ -476,7 +478,7 @@
 	if (virt_to_bus(CURRENT->buffer + CURRENT->nr_sectors * 512) > 16 * MB) {
 		printk("%s: DMA above 16MB not supported\n", DEVICE_NAME);
 		end_request(FAIL);
-		if (CURRENT)
+		if (!QUEUE_EMPTY)
 			do_ps2esdi_request(q);
 		return;
 	}			/* check for above 16Mb dmas */
@@ -510,7 +512,7 @@
 		default:
 			printk("%s: Unknown command\n", DEVICE_NAME);
 			end_request(FAIL);
-			if (CURRENT)
+			if (!QUEUE_EMPTY)
 				do_ps2esdi_request(q);
 			break;
 		}		/* handle different commands */
@@ -520,7 +522,7 @@
 		printk("Grrr. error. ps2esdi_drives: %d, %lu %lu\n", ps2esdi_drives,
 		       CURRENT->sector, ps2esdi[MINOR(CURRENT->rq_dev)].nr_sects);
 		end_request(FAIL);
-		if (CURRENT)
+		if (!QUEUE_EMPTY)
 			do_ps2esdi_request(q);
 	}
 
@@ -591,7 +593,7 @@
 			return do_ps2esdi_request(NULL);
 		else {
 			end_request(FAIL);
-			if (CURRENT)
+			if (!QUEUE_EMPTY)
 				do_ps2esdi_request(NULL);
 		}
 	}
@@ -894,7 +896,7 @@
 				do_ps2esdi_request(NULL);
 			else {
 				end_request(FAIL);
-				if (CURRENT)
+				if (!QUEUE_EMPTY)
 					do_ps2esdi_request(NULL);
 			}
 			break;
@@ -940,7 +942,7 @@
 			do_ps2esdi_request(NULL);
 		else {
 			end_request(FAIL);
-			if (CURRENT)
+			if (!QUEUE_EMPTY)
 				do_ps2esdi_request(NULL);
 		}
 		break;
@@ -950,7 +952,7 @@
 		outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
 		outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
 		end_request(FAIL);
-		if (CURRENT)
+		if (!QUEUE_EMPTY)
 			do_ps2esdi_request(NULL);
 		break;
 
@@ -986,7 +988,7 @@
 		do_ps2esdi_request(NULL);
 	} else {
 		end_request(SUCCES);
-		if (CURRENT)
+		if (!QUEUE_EMPTY)
 			do_ps2esdi_request(NULL);
 	}
 }

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