summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAlexander Viro <viro@math.psu.edu>2002-06-11 00:56:06 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-06-11 00:56:06 -0700
commit1b4199a5d8fe25d2faeaa67b79337db39b11d4c9 (patch)
treeef05c85dd122709c3992e7f38014b75c47045ee3 /drivers/block
parentb7031fe52611f9e0347c47f18cb50af520df0d78 (diff)
[PATCH] (11/14) resync
monstrous cascade of #ifdefs is gone from blk.h. This is the first step of cleanup - we move #define in question into the code that includes blk.h (i.e. DEVICE_NR, DEVICE_NAME and DEVICE_INTR are explicitly set by drivers).
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/acsi.c3
-rw-r--r--drivers/block/amiflop.c3
-rw-r--r--drivers/block/ataflop.c3
-rw-r--r--drivers/block/cpqarray.c2
-rw-r--r--drivers/block/floppy.c2
-rw-r--r--drivers/block/nbd.c2
-rw-r--r--drivers/block/ps2esdi.c2
-rw-r--r--drivers/block/rd.c4
-rw-r--r--drivers/block/swim3.c3
-rw-r--r--drivers/block/swim_iop.c3
-rw-r--r--drivers/block/xd.c2
-rw-r--r--drivers/block/z2ram.c2
12 files changed, 30 insertions, 1 deletions
diff --git a/drivers/block/acsi.c b/drivers/block/acsi.c
index c54a1effd933..f4fba3953851 100644
--- a/drivers/block/acsi.c
+++ b/drivers/block/acsi.c
@@ -44,6 +44,9 @@
*/
#define MAJOR_NR ACSI_MAJOR
+#define DEVICE_NAME "ACSI"
+#define DEVICE_INTR do_acsi
+#define DEVICE_NR(device) (minor(device) >> 4)
#include <linux/config.h>
#include <linux/module.h>
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index afac2dc96f61..2944997aab39 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -79,6 +79,9 @@
#include <asm/irq.h>
#define MAJOR_NR FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define DEVICE_INTR do_floppy
+#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
#undef DEBUG /* print _LOTS_ of infos */
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 85c691a0a6e8..81ef77131f5a 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -92,6 +92,9 @@
#include <asm/atari_stram.h>
#define MAJOR_NR FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define DEVICE_INTR do_floppy
+#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
#include <linux/blkpg.h>
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index a47217f06a4c..727cdeb23c0c 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -53,6 +53,8 @@ MODULE_LICENSE("GPL");
#define MAJOR_NR COMPAQ_SMART2_MAJOR
#define LOCAL_END_REQUEST
+#define DEVICE_NAME "ida"
+#define DEVICE_NR(device) (minor(device) >> 4)
#include <linux/blk.h>
#include <linux/blkdev.h>
#include <linux/genhd.h>
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 68bccecdd995..94f42b356556 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -240,6 +240,8 @@ static int irqdma_allocated;
#define LOCAL_END_REQUEST
#define MAJOR_NR FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
#include <linux/blkpg.h>
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index a7e00395ebac..50221d4d2e24 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -51,6 +51,8 @@
#include <asm/types.h>
#define MAJOR_NR NBD_MAJOR
+#define DEVICE_NAME "nbd"
+#define DEVICE_NR(device) (minor(device))
#include <linux/nbd.h>
#define LO_MAGIC 0x68797548
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
index 18a3ac58f87d..caac2a90c1d4 100644
--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -33,6 +33,8 @@
#ifdef CONFIG_BLK_DEV_PS2
#define MAJOR_NR PS2ESDI_MAJOR
+#define DEVICE_NAME "PS/2 ESDI"
+#define DEVICE_NR(device) (minor(device) >> 6)
#include <linux/errno.h>
#include <linux/sched.h>
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index e3ea81006e4a..f7960c652bd9 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -57,6 +57,8 @@
* include/linux/major.h for now
*/
#define MAJOR_NR RAMDISK_MAJOR
+#define DEVICE_NAME "ramdisk"
+#define DEVICE_NR(device) (minor(device))
#include <linux/blk.h>
#include <linux/blkpg.h>
@@ -357,7 +359,7 @@ static struct file_operations initrd_fops = {
static int rd_open(struct inode * inode, struct file * filp)
{
- int unit = DEVICE_NR(inode->i_rdev);
+ int unit = minor(inode->i_rdev);
#ifdef CONFIG_BLK_DEV_INITRD
if (unit == INITRD_MINOR) {
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 90c0f028829e..e4bb8aa5c7b0 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -33,6 +33,9 @@
#include <asm/pmac_feature.h>
#define MAJOR_NR FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define DEVICE_INTR do_floppy
+#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
#include <linux/devfs_fs_kernel.h>
diff --git a/drivers/block/swim_iop.c b/drivers/block/swim_iop.c
index 98a60662b2bf..133a22261a88 100644
--- a/drivers/block/swim_iop.c
+++ b/drivers/block/swim_iop.c
@@ -27,6 +27,9 @@
/* This has to be defined before some of the #includes below */
#define MAJOR_NR FLOPPY_MAJOR
+#define DEVICE_NAME "floppy"
+#define DEVICE_INTR do_floppy
+#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/stddef.h>
#include <linux/kernel.h>
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index a673ad5c057c..9f50246936e9 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -52,6 +52,8 @@
#include <asm/dma.h>
#define MAJOR_NR XT_DISK_MAJOR
+#define DEVICE_NAME "xt disk"
+#define DEVICE_NR(device) (minor(device) >> 6)
#include <linux/blk.h>
#include <linux/blkpg.h>
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 917f2ca3216c..cbaa293bf53a 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -26,6 +26,8 @@
*/
#define MAJOR_NR Z2RAM_MAJOR
+#define DEVICE_NAME "Z2RAM"
+#define DEVICE_NR(device) (minor(device))
#include <linux/major.h>
#include <linux/slab.h>