patch-2.1.126 linux/arch/ppc/kernel/pmac_setup.c

Next file: linux/drivers/block/Config.in
Previous file: linux/arch/mips/tools/offset.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.125/linux/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c
@@ -145,6 +145,12 @@
 #include "../../../drivers/scsi/sd.h"
 #include "../../../drivers/scsi/hosts.h"
 
+#define SD_MAJOR(i)		(!(i) ? SCSI_DISK0_MAJOR : SCSI_DISK1_MAJOR-1+(i))
+#define SD_MAJOR_NUMBER(i)	SD_MAJOR((i) >> 8)
+#define SD_MINOR_NUMBER(i)	((i) & 255)
+#define MKDEV_SD_PARTITION(i)	MKDEV(SD_MAJOR_NUMBER(i), SD_MINOR_NUMBER(i))
+#define MKDEV_SD(index)		MKDEV_SD_PARTITION((index) << 4)
+
 kdev_t sd_find_target(void *host, int tgt)
 {
     Scsi_Disk *dp;
@@ -153,7 +159,7 @@
     for (dp = rscsi_disks, i = 0; i < sd_template.dev_max; ++i, ++dp)
         if (dp->device != NULL && dp->device->host == host
             && dp->device->id == tgt)
-            return MKDEV(SCSI_DISK_MAJOR, i << 4);
+            return MKDEV_SD(i);
     return 0;
 }
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov