diff --git a/api/api_storage.c b/api/api_storage.c
index ec92ae4..bc2b4d6 100644
--- a/api/api_storage.c
+++ b/api/api_storage.c
@@ -345,19 +345,6 @@
 }
 
 
-static int dev_stor_index(block_dev_desc_t *dd)
-{
-	int i, type;
-
-	type = dev_stor_type(dd);
-	for (i = 0; i < specs[type].max_dev; i++)
-		if (dd == get_dev(specs[type].name, i))
-			return i;
-
-	return (specs[type].max_dev);
-}
-
-
 lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start)
 {
 	int type;
@@ -374,5 +361,5 @@
 		return 0;
 	}
 
-	return (dd->block_read(dev_stor_index(dd), start, len, buf));
+	return dd->block_read(dd, start, len, buf);
 }
diff --git a/board/freescale/common/sdhc_boot.c b/board/freescale/common/sdhc_boot.c
index 022f38b..e55a030 100644
--- a/board/freescale/common/sdhc_boot.c
+++ b/board/freescale/common/sdhc_boot.c
@@ -29,7 +29,7 @@
 		return 1;
 
 	/* read out the first block, get the config data information */
-	n = mmc->block_dev.block_read(mmc->block_dev.dev, 0, 1, tmp_buf);
+	n = mmc->block_dev.block_read(&mmc->block_dev, 0, 1, tmp_buf);
 	if (!n) {
 		free(tmp_buf);
 		return 1;
diff --git a/board/gdsys/p1022/controlcenterd-id.c b/board/gdsys/p1022/controlcenterd-id.c
index 11d075c..46a46c0 100644
--- a/board/gdsys/p1022/controlcenterd-id.c
+++ b/board/gdsys/p1022/controlcenterd-id.c
@@ -232,7 +232,7 @@
 	ofs = src % blk_len;
 
 	if (ofs) {
-		n = mmc->block_dev.block_read(mmc->block_dev.dev, block_no++, 1,
+		n = mmc->block_dev.block_read(&mmc->block_dev, block_no++, 1,
 			tmp_buf);
 		if (!n)
 			goto failure;
@@ -243,7 +243,7 @@
 	}
 	cnt = size / blk_len;
 	if (cnt) {
-		n = mmc->block_dev.block_read(mmc->block_dev.dev, block_no, cnt,
+		n = mmc->block_dev.block_read(&mmc->block_dev, block_no, cnt,
 			dst);
 		if (n != cnt)
 			goto failure;
@@ -253,7 +253,7 @@
 		block_no += cnt;
 	}
 	if (size) {
-		n = mmc->block_dev.block_read(mmc->block_dev.dev, block_no++, 1,
+		n = mmc->block_dev.block_read(&mmc->block_dev, block_no++, 1,
 			tmp_buf);
 		if (!n)
 			goto failure;
diff --git a/board/gdsys/p1022/sdhc_boot.c b/board/gdsys/p1022/sdhc_boot.c
index fd0e910..6a4a6ef 100644
--- a/board/gdsys/p1022/sdhc_boot.c
+++ b/board/gdsys/p1022/sdhc_boot.c
@@ -43,7 +43,7 @@
 		return 1;
 
 	/* read out the first block, get the config data information */
-	n = mmc->block_dev.block_read(mmc->block_dev.dev, 0, 1, tmp_buf);
+	n = mmc->block_dev.block_read(&mmc->block_dev, 0, 1, tmp_buf);
 	if (!n) {
 		free(tmp_buf);
 		return 1;
diff --git a/common/cmd_disk.c b/common/cmd_disk.c
index 8a1fda9..3025225 100644
--- a/common/cmd_disk.c
+++ b/common/cmd_disk.c
@@ -56,7 +56,7 @@
 	      ", Block Size: %ld\n",
 	      info.start, info.size, info.blksz);
 
-	if (dev_desc->block_read(dev, info.start, 1, (ulong *) addr) != 1) {
+	if (dev_desc->block_read(dev_desc, info.start, 1, (ulong *)addr) != 1) {
 		printf("** Read error on %d:%d\n", dev, part);
 		bootstage_error(BOOTSTAGE_ID_IDE_PART_READ);
 		return 1;
@@ -100,8 +100,8 @@
 	cnt /= info.blksz;
 	cnt -= 1;
 
-	if (dev_desc->block_read(dev, info.start + 1, cnt,
-					 (ulong *)(addr + info.blksz)) != cnt) {
+	if (dev_desc->block_read(dev_desc, info.start + 1, cnt,
+				 (ulong *)(addr + info.blksz)) != cnt) {
 		printf("** Read error on %d:%d\n", dev, part);
 		bootstage_error(BOOTSTAGE_ID_IDE_READ);
 		return 1;
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index ecd3e9d..f19a7ce 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -79,8 +79,8 @@
 
 #ifdef CONFIG_ATAPI
 static void	atapi_inquiry(block_dev_desc_t *dev_desc);
-static ulong atapi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
-			void *buffer);
+static ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+			lbaint_t blkcnt, void *buffer);
 #endif
 
 
@@ -187,6 +187,7 @@
 		if (strcmp(argv[1], "read") == 0) {
 			ulong addr = simple_strtoul(argv[2], NULL, 16);
 			ulong cnt = simple_strtoul(argv[4], NULL, 16);
+			block_dev_desc_t *dev_desc;
 			ulong n;
 
 #ifdef CONFIG_SYS_64BIT_LBA
@@ -201,9 +202,9 @@
 				curr_device, blk, cnt);
 #endif
 
-			n = ide_dev_desc[curr_device].block_read(curr_device,
-								 blk, cnt,
-								 (ulong *)addr);
+			dev_desc = &ide_dev_desc[curr_device];
+			n = dev_desc->block_read(dev_desc, blk, cnt,
+						 (ulong *)addr);
 			/* flush cache after read */
 			flush_cache(addr,
 				    cnt * ide_dev_desc[curr_device].blksz);
@@ -230,7 +231,8 @@
 			printf("\nIDE write: device %d block # %ld, count %ld ... ",
 				curr_device, blk, cnt);
 #endif
-			n = ide_write(curr_device, blk, cnt, (ulong *) addr);
+			n = ide_write(&ide_dev_desc[curr_device], blk, cnt,
+				      (ulong *)addr);
 
 			printf("%ld blocks written: %s\n",
 				n, (n == cnt) ? "OK" : "ERROR");
@@ -711,8 +713,10 @@
 
 /* ------------------------------------------------------------------------- */
 
-ulong ide_read(int device, lbaint_t blknr, lbaint_t blkcnt, void *buffer)
+ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+	       void *buffer)
 {
+	int device = block_dev->dev;
 	ulong n = 0;
 	unsigned char c;
 	unsigned char pwrsave = 0;	/* power save */
@@ -835,8 +839,10 @@
 /* ------------------------------------------------------------------------- */
 
 
-ulong ide_write(int device, lbaint_t blknr, lbaint_t blkcnt, const void *buffer)
+ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+		const void *buffer)
 {
+	int device = block_dev->dev;
 	ulong n = 0;
 	unsigned char c;
 
@@ -1388,8 +1394,10 @@
 #define ATAPI_READ_BLOCK_SIZE	2048	/* assuming CD part */
 #define ATAPI_READ_MAX_BLOCK	(ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE)
 
-ulong atapi_read(int device, lbaint_t blknr, lbaint_t blkcnt, void *buffer)
+ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+		 void *buffer)
 {
+	int device = block_dev->dev;
 	ulong n = 0;
 	unsigned char ccb[12];	/* Command descriptor block */
 	ulong cnt;
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index a6b7313..6b5c1ac 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -351,7 +351,7 @@
 	printf("\nMMC read: dev # %d, block # %d, count %d ... ",
 	       curr_device, blk, cnt);
 
-	n = mmc->block_dev.block_read(curr_device, blk, cnt, addr);
+	n = mmc->block_dev.block_read(&mmc->block_dev, blk, cnt, addr);
 	/* flush cache after read */
 	flush_cache((ulong)addr, cnt * 512); /* FIXME */
 	printf("%d blocks read: %s\n", n, (n == cnt) ? "OK" : "ERROR");
@@ -383,7 +383,7 @@
 		printf("Error: card is write protected!\n");
 		return CMD_RET_FAILURE;
 	}
-	n = mmc->block_dev.block_write(curr_device, blk, cnt, addr);
+	n = mmc->block_dev.block_write(&mmc->block_dev, blk, cnt, addr);
 	printf("%d blocks written: %s\n", n, (n == cnt) ? "OK" : "ERROR");
 
 	return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
@@ -411,7 +411,7 @@
 		printf("Error: card is write protected!\n");
 		return CMD_RET_FAILURE;
 	}
-	n = mmc->block_dev.block_erase(curr_device, blk, cnt);
+	n = mmc->block_dev.block_erase(&mmc->block_dev, blk, cnt);
 	printf("%d blocks erased: %s\n", n, (n == cnt) ? "OK" : "ERROR");
 
 	return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
diff --git a/common/cmd_read.c b/common/cmd_read.c
index f0fc9bf..8710288 100644
--- a/common/cmd_read.c
+++ b/common/cmd_read.c
@@ -66,7 +66,7 @@
 		return 1;
 	}
 
-	if (dev_desc->block_read(dev, offset + blk, cnt, addr) < 0) {
+	if (dev_desc->block_read(dev_desc, offset + blk, cnt, addr) < 0) {
 		printf("Error reading blocks\n");
 		return 1;
 	}
diff --git a/common/cmd_sata.c b/common/cmd_sata.c
index 51f6703..76bacea 100644
--- a/common/cmd_sata.c
+++ b/common/cmd_sata.c
@@ -18,6 +18,18 @@
 static int sata_curr_device = -1;
 block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
 
+static unsigned long sata_bread(block_dev_desc_t *block_dev, lbaint_t start,
+				lbaint_t blkcnt, void *dst)
+{
+	return sata_read(block_dev->dev, start, blkcnt, dst);
+}
+
+static unsigned long sata_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
+				 lbaint_t blkcnt, const void *buffer)
+{
+	return sata_write(block_dev->dev, start, blkcnt, buffer);
+}
+
 int __sata_initialize(void)
 {
 	int rc;
@@ -32,8 +44,8 @@
 		sata_dev_desc[i].lba = 0;
 		sata_dev_desc[i].blksz = 512;
 		sata_dev_desc[i].log2blksz = LOG2(sata_dev_desc[i].blksz);
-		sata_dev_desc[i].block_read = sata_read;
-		sata_dev_desc[i].block_write = sata_write;
+		sata_dev_desc[i].block_read = sata_bread;
+		sata_dev_desc[i].block_write = sata_bwrite;
 
 		rc = init_sata(i);
 		if (!rc) {
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index 8695408..bc7d1b6 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -66,9 +66,9 @@
 
 static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity,
 			      unsigned long *blksz);
-static ulong scsi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
-		       void *buffer);
-static ulong scsi_write(int device, lbaint_t blknr,
+static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+		       lbaint_t blkcnt, void *buffer);
+static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
 			lbaint_t blkcnt, const void *buffer);
 
 
@@ -346,7 +346,8 @@
 				ulong n;
 				printf ("\nSCSI read: device %d block # %ld, count %ld ... ",
 						scsi_curr_dev, blk, cnt);
-				n = scsi_read(scsi_curr_dev, blk, cnt, (ulong *)addr);
+				n = scsi_read(&scsi_dev_desc[scsi_curr_dev],
+					      blk, cnt, (ulong *)addr);
 				printf ("%ld blocks read: %s\n",n,(n==cnt) ? "OK" : "ERROR");
 				return 0;
 			} else if (strcmp(argv[1], "write") == 0) {
@@ -357,8 +358,8 @@
 				printf("\nSCSI write: device %d block # %ld, "
 				       "count %ld ... ",
 				       scsi_curr_dev, blk, cnt);
-				n = scsi_write(scsi_curr_dev, blk, cnt,
-					       (ulong *)addr);
+				n = scsi_write(&scsi_dev_desc[scsi_curr_dev],
+					       blk, cnt, (ulong *)addr);
 				printf("%ld blocks written: %s\n", n,
 				       (n == cnt) ? "OK" : "ERROR");
 				return 0;
@@ -375,9 +376,10 @@
 #define SCSI_MAX_READ_BLK 0xFFFF
 #define SCSI_LBA48_READ	0xFFFFFFF
 
-static ulong scsi_read(int device, lbaint_t blknr, lbaint_t blkcnt,
-		       void *buffer)
+static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+		       lbaint_t blkcnt, void *buffer)
 {
+	int device = block_dev->dev;
 	lbaint_t start, blks;
 	uintptr_t buf_addr;
 	unsigned short smallblks = 0;
@@ -441,9 +443,10 @@
 /* Almost the maximum amount of the scsi_ext command.. */
 #define SCSI_MAX_WRITE_BLK 0xFFFF
 
-static ulong scsi_write(int device, lbaint_t blknr,
+static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
 			lbaint_t blkcnt, const void *buffer)
 {
+	int device = block_dev->dev;
 	lbaint_t start, blks;
 	uintptr_t buf_addr;
 	unsigned short smallblks;
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index a540b42..c7b642c 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -759,7 +759,7 @@
 			printf("\nUSB read: device %d block # %ld, count %ld"
 				" ... ", usb_stor_curr_dev, blk, cnt);
 			stor_dev = usb_stor_get_dev(usb_stor_curr_dev);
-			n = stor_dev->block_read(usb_stor_curr_dev, blk, cnt,
+			n = stor_dev->block_read(stor_dev, blk, cnt,
 						 (ulong *)addr);
 			printf("%ld blocks read: %s\n", n,
 				(n == cnt) ? "OK" : "ERROR");
@@ -781,7 +781,7 @@
 			printf("\nUSB write: device %d block # %ld, count %ld"
 				" ... ", usb_stor_curr_dev, blk, cnt);
 			stor_dev = usb_stor_get_dev(usb_stor_curr_dev);
-			n = stor_dev->block_write(usb_stor_curr_dev, blk, cnt,
+			n = stor_dev->block_write(stor_dev, blk, cnt,
 						(ulong *)addr);
 			printf("%ld blocks write: %s\n", n,
 				(n == cnt) ? "OK" : "ERROR");
diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c
index 0407389..f4bafec 100644
--- a/common/cmd_usb_mass_storage.c
+++ b/common/cmd_usb_mass_storage.c
@@ -19,9 +19,8 @@
 {
 	block_dev_desc_t *block_dev = ums_dev->block_dev;
 	lbaint_t blkstart = start + ums_dev->start_sector;
-	int dev_num = block_dev->dev;
 
-	return block_dev->block_read(dev_num, blkstart, blkcnt, buf);
+	return block_dev->block_read(block_dev, blkstart, blkcnt, buf);
 }
 
 static int ums_write_sector(struct ums *ums_dev,
@@ -29,9 +28,8 @@
 {
 	block_dev_desc_t *block_dev = ums_dev->block_dev;
 	lbaint_t blkstart = start + ums_dev->start_sector;
-	int dev_num = block_dev->dev;
 
-	return block_dev->block_write(dev_num, blkstart, blkcnt, buf);
+	return block_dev->block_write(block_dev, blkstart, blkcnt, buf);
 }
 
 static struct ums ums_dev = {
diff --git a/common/env_mmc.c b/common/env_mmc.c
index 9639822..f182749 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -127,7 +127,7 @@
 	blk_start	= ALIGN(offset, mmc->write_bl_len) / mmc->write_bl_len;
 	blk_cnt		= ALIGN(size, mmc->write_bl_len) / mmc->write_bl_len;
 
-	n = mmc->block_dev.block_write(CONFIG_SYS_MMC_ENV_DEV, blk_start,
+	n = mmc->block_dev.block_write(&mmc->block_dev, blk_start,
 					blk_cnt, (u_char *)buffer);
 
 	return (n == blk_cnt) ? 0 : -1;
@@ -192,16 +192,12 @@
 			   unsigned long offset, const void *buffer)
 {
 	uint blk_start, blk_cnt, n;
-	int dev = CONFIG_SYS_MMC_ENV_DEV;
-
-#ifdef CONFIG_SPL_BUILD
-	dev = 0;
-#endif
 
 	blk_start	= ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len;
 	blk_cnt		= ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len;
 
-	n = mmc->block_dev.block_read(dev, blk_start, blk_cnt, (uchar *)buffer);
+	n = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt,
+				      (uchar *)buffer);
 
 	return (n == blk_cnt) ? 0 : -1;
 }
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index b480e76..6e742da 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -58,7 +58,7 @@
 	block_dev_desc_t *dev_desc = sparse->dev_desc;
 	int ret;
 
-	ret = dev_desc->block_write(dev_desc->dev, offset, size, data);
+	ret = dev_desc->block_write(dev_desc, offset, size, data);
 	if (!ret)
 		return -EIO;
 
@@ -84,8 +84,7 @@
 
 	puts("Flashing Raw Image\n");
 
-	blks = dev_desc->block_write(dev_desc->dev, info->start, blkcnt,
-				     buffer);
+	blks = dev_desc->block_write(dev_desc, info->start, blkcnt, buffer);
 	if (blks != blkcnt) {
 		error("failed writing to device %d\n", dev_desc->dev);
 		fastboot_fail(response_str, "failed writing to device");
@@ -206,7 +205,7 @@
 	printf("Erasing blocks " LBAFU " to " LBAFU " due to alignment\n",
 	       blks_start, blks_start + blks_size);
 
-	blks = dev_desc->block_erase(dev_desc->dev, blks_start, blks_size);
+	blks = dev_desc->block_erase(dev_desc, blks_start, blks_size);
 	if (blks != blks_size) {
 		error("failed erasing from device %d", dev_desc->dev);
 		fastboot_fail(response_str, "failed erasing from device");
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index c1c29c0..c3931c6 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -23,13 +23,12 @@
 	unsigned long count;
 	u32 image_size_sectors;
 	struct image_header *header;
-	int dev_num = mmc->block_dev.dev;
 
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
 					 sizeof(struct image_header));
 
 	/* read image header to find the image size & load address */
-	count = mmc->block_dev.block_read(dev_num, sector, 1, header);
+	count = mmc->block_dev.block_read(&mmc->block_dev, sector, 1, header);
 	debug("read sector %lx, count=%lu\n", sector, count);
 	if (count == 0)
 		goto end;
@@ -46,7 +45,8 @@
 			     mmc->read_bl_len;
 
 	/* Read the header too to avoid extra memcpy */
-	count = mmc->block_dev.block_read(dev_num, sector, image_size_sectors,
+	count = mmc->block_dev.block_read(&mmc->block_dev, sector,
+					  image_size_sectors,
 					  (void *)(ulong)spl_image.load_addr);
 	debug("read %x sectors to %x\n", image_size_sectors,
 	      spl_image.load_addr);
@@ -150,8 +150,7 @@
 {
 	unsigned long count;
 
-	count = mmc->block_dev.block_read(
-		mmc->block_dev.dev,
+	count = mmc->block_dev.block_read(&mmc->block_dev,
 		CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
 		CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
 		(void *) CONFIG_SYS_SPL_ARGS_ADDR);
diff --git a/common/usb_storage.c b/common/usb_storage.c
index e61a8c8..4fdb55f 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -119,10 +119,10 @@
 		      block_dev_desc_t *dev_desc);
 int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
 		      struct us_data *ss);
-unsigned long usb_stor_read(int device, lbaint_t blknr,
-			    lbaint_t blkcnt, void *buffer);
-unsigned long usb_stor_write(int device, lbaint_t blknr,
-			     lbaint_t blkcnt, const void *buffer);
+static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+				   lbaint_t blkcnt, void *buffer);
+static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
+				    lbaint_t blkcnt, const void *buffer);
 void uhci_show_temp_int_td(void);
 
 #ifdef CONFIG_PARTITIONS
@@ -1027,9 +1027,10 @@
 }
 #endif /* CONFIG_USB_BIN_FIXUP */
 
-unsigned long usb_stor_read(int device, lbaint_t blknr,
-			    lbaint_t blkcnt, void *buffer)
+static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+				   lbaint_t blkcnt, void *buffer)
 {
+	int device = block_dev->dev;
 	lbaint_t start, blks;
 	uintptr_t buf_addr;
 	unsigned short smallblks;
@@ -1097,9 +1098,10 @@
 	return blkcnt;
 }
 
-unsigned long usb_stor_write(int device, lbaint_t blknr,
-				lbaint_t blkcnt, const void *buffer)
+static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
+				    lbaint_t blkcnt, const void *buffer)
 {
+	int device = block_dev->dev;
 	lbaint_t start, blks;
 	uintptr_t buf_addr;
 	unsigned short smallblks;
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index 260a3d5..57c1b9d 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -140,8 +140,7 @@
 
     for (i=0; i<limit; i++)
     {
-	ulong res = dev_desc->block_read(dev_desc->dev, i, 1,
-					 (ulong *)block_buffer);
+	ulong res = dev_desc->block_read(dev_desc, i, 1, (ulong *)block_buffer);
 	if (res == 1)
 	{
 	    struct rigid_disk_block *trdb = (struct rigid_disk_block *)block_buffer;
@@ -183,7 +182,7 @@
 
     for (i = 0; i < limit; i++)
     {
-	ulong res = dev_desc->block_read(dev_desc->dev, i, 1, (ulong *)block_buffer);
+	ulong res = dev_desc->block_read(dev_desc, i, 1, (ulong *)block_buffer);
 	if (res == 1)
 	{
 	    struct bootcode_block *boot = (struct bootcode_block *)block_buffer;
@@ -258,7 +257,7 @@
 
     while (block != 0xFFFFFFFF)
     {
-	ulong res = dev_desc->block_read(dev_desc->dev, block, 1,
+	ulong res = dev_desc->block_read(dev_desc, block, 1,
 					 (ulong *)block_buffer);
 	if (res == 1)
 	{
@@ -354,8 +353,7 @@
 
 	PRINTF("Trying to load block #0x%X\n", block);
 
-	res = dev_desc->block_read(dev_desc->dev, block, 1,
-				   (ulong *)block_buffer);
+	res = dev_desc->block_read(dev_desc, block, 1, (ulong *)block_buffer);
 	if (res == 1)
 	{
 	    p = (struct partition_block *)block_buffer;
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 6280660..1e5cb33 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -91,7 +91,7 @@
 {
 	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 
-	if (dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 1)
+	if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)buffer) != 1)
 		return -1;
 
 	if (test_block_type(buffer) != DOS_MBR)
@@ -111,7 +111,8 @@
 	dos_partition_t *pt;
 	int i;
 
-	if (dev_desc->block_read(dev_desc->dev, ext_part_sector, 1, (ulong *) buffer) != 1) {
+	if (dev_desc->block_read(dev_desc, ext_part_sector, 1,
+				 (ulong *)buffer) != 1) {
 		printf ("** Can't read partition table on %d:" LBAFU " **\n",
 			dev_desc->dev, ext_part_sector);
 		return;
@@ -177,7 +178,8 @@
 	int i;
 	int dos_type;
 
-	if (dev_desc->block_read (dev_desc->dev, ext_part_sector, 1, (ulong *) buffer) != 1) {
+	if (dev_desc->block_read(dev_desc, ext_part_sector, 1,
+				 (ulong *)buffer) != 1) {
 		printf ("** Can't read partition table on %d:" LBAFU " **\n",
 			dev_desc->dev, ext_part_sector);
 		return -1;
diff --git a/disk/part_efi.c b/disk/part_efi.c
index b1e0155..22dfbb1 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -324,7 +324,7 @@
 	ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz);
 
 	/* Read legacy MBR from block 0 and validate it */
-	if ((dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *)legacymbr) != 1)
+	if ((dev_desc->block_read(dev_desc, 0, 1, (ulong *)legacymbr) != 1)
 		|| (is_pmbr_valid(legacymbr) != 1)) {
 		return -1;
 	}
@@ -354,7 +354,7 @@
 	p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba - 1;
 
 	/* Write MBR sector to the MMC device */
-	if (dev_desc->block_write(dev_desc->dev, 0, 1, p_mbr) != 1) {
+	if (dev_desc->block_write(dev_desc, 0, 1, p_mbr) != 1) {
 		printf("** Can't write to device %d **\n",
 			dev_desc->dev);
 		return -1;
@@ -386,22 +386,22 @@
 	gpt_h->header_crc32 = cpu_to_le32(calc_crc32);
 
 	/* Write the First GPT to the block right after the Legacy MBR */
-	if (dev_desc->block_write(dev_desc->dev, 1, 1, gpt_h) != 1)
+	if (dev_desc->block_write(dev_desc, 1, 1, gpt_h) != 1)
 		goto err;
 
-	if (dev_desc->block_write(dev_desc->dev, 2, pte_blk_cnt, gpt_e)
+	if (dev_desc->block_write(dev_desc, 2, pte_blk_cnt, gpt_e)
 	    != pte_blk_cnt)
 		goto err;
 
 	prepare_backup_gpt_header(gpt_h);
 
-	if (dev_desc->block_write(dev_desc->dev,
+	if (dev_desc->block_write(dev_desc,
 				  (lbaint_t)le64_to_cpu(gpt_h->last_usable_lba)
 				  + 1,
 				  pte_blk_cnt, gpt_e) != pte_blk_cnt)
 		goto err;
 
-	if (dev_desc->block_write(dev_desc->dev,
+	if (dev_desc->block_write(dev_desc,
 				  (lbaint_t)le64_to_cpu(gpt_h->my_lba), 1,
 				  gpt_h) != 1)
 		goto err;
@@ -737,7 +737,7 @@
 	/* write MBR */
 	lba = 0;	/* MBR is always at 0 */
 	cnt = 1;	/* MBR (1 block) */
-	if (dev_desc->block_write(dev_desc->dev, lba, cnt, buf) != cnt) {
+	if (dev_desc->block_write(dev_desc, lba, cnt, buf) != cnt) {
 		printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n",
 		       __func__, "MBR", cnt, lba);
 		return 1;
@@ -746,7 +746,7 @@
 	/* write Primary GPT */
 	lba = GPT_PRIMARY_PARTITION_TABLE_LBA;
 	cnt = 1;	/* GPT Header (1 block) */
-	if (dev_desc->block_write(dev_desc->dev, lba, cnt, gpt_h) != cnt) {
+	if (dev_desc->block_write(dev_desc, lba, cnt, gpt_h) != cnt) {
 		printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n",
 		       __func__, "Primary GPT Header", cnt, lba);
 		return 1;
@@ -754,7 +754,7 @@
 
 	lba = le64_to_cpu(gpt_h->partition_entry_lba);
 	cnt = gpt_e_blk_cnt;
-	if (dev_desc->block_write(dev_desc->dev, lba, cnt, gpt_e) != cnt) {
+	if (dev_desc->block_write(dev_desc, lba, cnt, gpt_e) != cnt) {
 		printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n",
 		       __func__, "Primary GPT Entries", cnt, lba);
 		return 1;
@@ -765,7 +765,7 @@
 	/* write Backup GPT */
 	lba = le64_to_cpu(gpt_h->partition_entry_lba);
 	cnt = gpt_e_blk_cnt;
-	if (dev_desc->block_write(dev_desc->dev, lba, cnt, gpt_e) != cnt) {
+	if (dev_desc->block_write(dev_desc, lba, cnt, gpt_e) != cnt) {
 		printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n",
 		       __func__, "Backup GPT Entries", cnt, lba);
 		return 1;
@@ -773,7 +773,7 @@
 
 	lba = le64_to_cpu(gpt_h->my_lba);
 	cnt = 1;	/* GPT Header (1 block) */
-	if (dev_desc->block_write(dev_desc->dev, lba, cnt, gpt_h) != cnt) {
+	if (dev_desc->block_write(dev_desc, lba, cnt, gpt_h) != cnt) {
 		printf("%s: failed writing '%s' (%d blks at 0x" LBAF ")\n",
 		       __func__, "Backup GPT Header", cnt, lba);
 		return 1;
@@ -843,8 +843,7 @@
 	}
 
 	/* Read GPT Header from device */
-	if (dev_desc->block_read(dev_desc->dev, (lbaint_t)lba, 1, pgpt_head)
-			!= 1) {
+	if (dev_desc->block_read(dev_desc, (lbaint_t)lba, 1, pgpt_head) != 1) {
 		printf("*** ERROR: Can't read GPT header ***\n");
 		return 0;
 	}
@@ -881,6 +880,7 @@
 					 gpt_header * pgpt_head)
 {
 	size_t count = 0, blk_cnt;
+	lbaint_t blk;
 	gpt_entry *pte = NULL;
 
 	if (!dev_desc || !pgpt_head) {
@@ -909,12 +909,10 @@
 	}
 
 	/* Read GPT Entries from device */
+	blk = le64_to_cpu(pgpt_head->partition_entry_lba);
 	blk_cnt = BLOCK_CNT(count, dev_desc);
-	if (dev_desc->block_read (dev_desc->dev,
-		(lbaint_t)le64_to_cpu(pgpt_head->partition_entry_lba),
-		(lbaint_t) (blk_cnt), pte)
-		!= blk_cnt) {
-
+	if (dev_desc->block_read(dev_desc, blk, (lbaint_t)blk_cnt, pte)
+	    != blk_cnt) {
 		printf("*** ERROR: Can't read GPT Entries ***\n");
 		free(pte);
 		return NULL;
diff --git a/disk/part_iso.c b/disk/part_iso.c
index 2547c70..0b1ac60 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -62,8 +62,8 @@
 
 	/* the first sector (sector 0x10) must be a primary volume desc */
 	blkaddr=PVD_OFFSET;
-	if (dev_desc->block_read (dev_desc->dev, PVD_OFFSET, 1, (ulong *) tmpbuf) != 1)
-	return (-1);
+	if (dev_desc->block_read(dev_desc, PVD_OFFSET, 1, (ulong *)tmpbuf) != 1)
+		return -1;
 	if(ppr->desctype!=0x01) {
 		if(verb)
 			printf ("** First descriptor is NOT a primary desc on %d:%d **\n",
@@ -84,8 +84,8 @@
 	PRINTF(" Lastsect:%08lx\n",lastsect);
 	for(i=blkaddr;i<lastsect;i++) {
 		PRINTF("Reading block %d\n", i);
-		if (dev_desc->block_read (dev_desc->dev, i, 1, (ulong *) tmpbuf) != 1)
-		return (-1);
+		if (dev_desc->block_read(dev_desc, i, 1, (ulong *)tmpbuf) != 1)
+			return -1;
 		if(ppr->desctype==0x00)
 			break; /* boot entry found */
 		if(ppr->desctype==0xff) {
@@ -104,7 +104,7 @@
 	}
 	bootaddr=le32_to_int(pbr->pointer);
 	PRINTF(" Boot Entry at: %08lX\n",bootaddr);
-	if (dev_desc->block_read (dev_desc->dev, bootaddr, 1, (ulong *) tmpbuf) != 1) {
+	if (dev_desc->block_read(dev_desc, bootaddr, 1, (ulong *)tmpbuf) != 1) {
 		if(verb)
 			printf ("** Can't read Boot Entry at %lX on %d:%d **\n",
 				bootaddr,dev_desc->dev, part_num);
diff --git a/disk/part_mac.c b/disk/part_mac.c
index 099e0a0..f3bc8dd 100644
--- a/disk/part_mac.c
+++ b/disk/part_mac.c
@@ -51,7 +51,8 @@
 
 	n = 1;	/* assuming at least one partition */
 	for (i=1; i<=n; ++i) {
-		if ((dev_desc->block_read(dev_desc->dev, i, 1, (ulong *)mpart) != 1) ||
+		if ((dev_desc->block_read(dev_desc, i, 1,
+					  (ulong *)mpart) != 1) ||
 		    (mpart->signature != MAC_PARTITION_MAGIC) ) {
 			return (-1);
 		}
@@ -104,7 +105,7 @@
 		char c;
 
 		printf ("%4ld: ", i);
-		if (dev_desc->block_read (dev_desc->dev, i, 1, (ulong *)mpart) != 1) {
+		if (dev_desc->block_read(dev_desc, i, 1, (ulong *)mpart) != 1) {
 			printf ("** Can't read Partition Map on %d:%ld **\n",
 				dev_desc->dev, i);
 			return;
@@ -150,7 +151,7 @@
  */
 static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb_p)
 {
-	if (dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *)ddb_p) != 1) {
+	if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)ddb_p) != 1) {
 		printf ("** Can't read Driver Desriptor Block **\n");
 		return (-1);
 	}
@@ -178,7 +179,7 @@
 		 * partition 1 first since this is the only way to
 		 * know how many partitions we have.
 		 */
-		if (dev_desc->block_read (dev_desc->dev, n, 1, (ulong *)pdb_p) != 1) {
+		if (dev_desc->block_read(dev_desc, n, 1, (ulong *)pdb_p) != 1) {
 			printf ("** Can't read Partition Map on %d:%d **\n",
 				dev_desc->dev, n);
 			return (-1);
diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c
index 73f4c4a..170f0fa 100644
--- a/drivers/block/sandbox.c
+++ b/drivers/block/sandbox.c
@@ -22,9 +22,11 @@
 	return NULL;
 }
 
-static unsigned long host_block_read(int dev, unsigned long start,
-				     lbaint_t blkcnt, void *buffer)
+static unsigned long host_block_read(block_dev_desc_t *block_dev,
+				     unsigned long start, lbaint_t blkcnt,
+				     void *buffer)
 {
+	int dev = block_dev->dev;
 	struct host_block_dev *host_dev = find_host_device(dev);
 
 	if (!host_dev)
@@ -42,9 +44,11 @@
 	return -1;
 }
 
-static unsigned long host_block_write(int dev, unsigned long start,
-				      lbaint_t blkcnt, const void *buffer)
+static unsigned long host_block_write(block_dev_desc_t *block_dev,
+				      unsigned long start, lbaint_t blkcnt,
+				      const void *buffer)
 {
+	int dev = block_dev->dev;
 	struct host_block_dev *host_dev = find_host_device(dev);
 	if (os_lseek(host_dev->fd,
 		     start * host_dev->blk_dev.blksz,
diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c
index fdf75b5..b974e80 100644
--- a/drivers/block/systemace.c
+++ b/drivers/block/systemace.c
@@ -69,8 +69,9 @@
 	return in16(base + off);
 }
 
-static unsigned long systemace_read(int dev, unsigned long start,
-					lbaint_t blkcnt, void *buffer);
+static unsigned long systemace_read(block_dev_desc_t *block_dev,
+				    unsigned long start, lbaint_t blkcnt,
+				    void *buffer);
 
 static block_dev_desc_t systemace_dev = { 0 };
 
@@ -136,8 +137,9 @@
  * the dev_desc) to read blocks of data. The return value is the
  * number of blocks read. A zero return indicates an error.
  */
-static unsigned long systemace_read(int dev, unsigned long start,
-					lbaint_t blkcnt, void *buffer)
+static unsigned long systemace_read(block_dev_desc_t *block_dev,
+				    unsigned long start, lbaint_t blkcnt,
+				    void *buffer)
 {
 	int retry;
 	unsigned blk_countdown;
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index 5a9fb4a..7ff2a81 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -77,11 +77,11 @@
 	      dfu->data.mmc.dev_num, blk_start, blk_count, buf);
 	switch (op) {
 	case DFU_OP_READ:
-		n = mmc->block_dev.block_read(dfu->data.mmc.dev_num, blk_start,
+		n = mmc->block_dev.block_read(&mmc->block_dev, blk_start,
 					      blk_count, buf);
 		break;
 	case DFU_OP_WRITE:
-		n = mmc->block_dev.block_write(dfu->data.mmc.dev_num, blk_start,
+		n = mmc->block_dev.block_write(&mmc->block_dev, blk_start,
 					       blk_count, buf);
 		break;
 	default:
diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
index b1cb4b3..301d9b3 100644
--- a/drivers/mmc/fsl_esdhc_spl.c
+++ b/drivers/mmc/fsl_esdhc_spl.c
@@ -38,7 +38,8 @@
 	blk_start = ALIGN(offs, mmc->read_bl_len) / mmc->read_bl_len;
 	blk_cnt = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len;
 
-	err = mmc->block_dev.block_read(0, blk_start, blk_cnt, vdst);
+	err = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt,
+					vdst);
 	if (err != blk_cnt) {
 		puts("spl: mmc read failed!!\n");
 		hang();
@@ -85,7 +86,8 @@
 	/*
 	* Read source addr from sd card
 	*/
-	err = mmc->block_dev.block_read(0, CONFIG_CFG_DATA_SECTOR, 1, tmp_buf);
+	err = mmc->block_dev.block_read(&mmc->block_dev,
+					CONFIG_CFG_DATA_SECTOR, 1, tmp_buf);
 	if (err != 1) {
 		puts("spl: mmc read failed!!\n");
 		free(tmp_buf);
@@ -126,7 +128,7 @@
 #endif
 	blk_start = ALIGN(offset, mmc->read_bl_len) / mmc->read_bl_len;
 	blk_cnt = ALIGN(code_len, mmc->read_bl_len) / mmc->read_bl_len;
-	err = mmc->block_dev.block_read(0, blk_start, blk_cnt,
+	err = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt,
 					(uchar *)CONFIG_SYS_MMC_U_BOOT_DST);
 	if (err != blk_cnt) {
 		puts("spl: mmc read failed!!\n");
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 3a34028..6d88db4 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -234,8 +234,10 @@
 	return blkcnt;
 }
 
-static ulong mmc_bread(int dev_num, lbaint_t start, lbaint_t blkcnt, void *dst)
+static ulong mmc_bread(block_dev_desc_t *block_dev, lbaint_t start,
+		       lbaint_t blkcnt, void *dst)
 {
+	int dev_num = block_dev->dev;
 	lbaint_t cur, blocks_todo = blkcnt;
 
 	if (blkcnt == 0)
diff --git a/drivers/mmc/mmc_private.h b/drivers/mmc/mmc_private.h
index 447a700..6a70639 100644
--- a/drivers/mmc/mmc_private.h
+++ b/drivers/mmc/mmc_private.h
@@ -22,23 +22,24 @@
 
 #ifndef CONFIG_SPL_BUILD
 
-extern unsigned long mmc_berase(int dev_num, lbaint_t start, lbaint_t blkcnt);
+unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start,
+			 lbaint_t blkcnt);
 
-extern ulong mmc_bwrite(int dev_num, lbaint_t start, lbaint_t blkcnt,
-		const void *src);
+unsigned long mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
+			 lbaint_t blkcnt, const void *src);
 
 #else /* CONFIG_SPL_BUILD */
 
 /* SPL will never write or erase, declare dummies to reduce code size. */
 
-static inline unsigned long mmc_berase(int dev_num, lbaint_t start,
-		lbaint_t blkcnt)
+static inline unsigned long mmc_berase(block_dev_desc_t *block_dev,
+				       lbaint_t start, lbaint_t blkcnt)
 {
 	return 0;
 }
 
-static inline ulong mmc_bwrite(int dev_num, lbaint_t start, lbaint_t blkcnt,
-		const void *src)
+static inline ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
+			       lbaint_t blkcnt, const void *src)
 {
 	return 0;
 }
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
index 221bf30..6733314 100644
--- a/drivers/mmc/mmc_write.c
+++ b/drivers/mmc/mmc_write.c
@@ -65,8 +65,10 @@
 	return err;
 }
 
-unsigned long mmc_berase(int dev_num, lbaint_t start, lbaint_t blkcnt)
+unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start,
+			 lbaint_t blkcnt)
 {
+	int dev_num = block_dev->dev;
 	int err = 0;
 	u32 start_rem, blkcnt_rem;
 	struct mmc *mmc = find_mmc_device(dev_num);
@@ -165,8 +167,10 @@
 	return blkcnt;
 }
 
-ulong mmc_bwrite(int dev_num, lbaint_t start, lbaint_t blkcnt, const void *src)
+ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, lbaint_t blkcnt,
+		 const void *src)
 {
+	int dev_num = block_dev->dev;
 	lbaint_t cur, blocks_todo = blkcnt;
 
 	struct mmc *mmc = find_mmc_device(dev_num);
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index e717c44..7b33094 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -454,7 +454,7 @@
 		panic("Failed to allocate memory\n");
 
 	if (mmc_getcd(mmc) && mmc_init(mmc) == 0 &&
-	    mmc->block_dev.block_read(mmc->block_dev.dev, 16, 1, buf) == 1 &&
+	    mmc->block_dev.block_read(&mmc->block_dev, 16, 1, buf) == 1 &&
 	    strncmp(&buf[4], "eGON.BT0", 8) == 0)
 		valid_signature = 1;
 
diff --git a/drivers/net/fm/fm.c b/drivers/net/fm/fm.c
index df5db72..40fbf19 100644
--- a/drivers/net/fm/fm.c
+++ b/drivers/net/fm/fm.c
@@ -395,7 +395,8 @@
 		printf("\nMMC read: dev # %u, block # %u, count %u ...\n",
 				dev, blk, cnt);
 		mmc_init(mmc);
-		(void)mmc->block_dev.block_read(dev, blk, cnt, addr);
+		(void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
+						addr);
 		/* flush cache after read */
 		flush_cache((ulong)addr, cnt * 512);
 	}
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c
index 3a2b3bb..447ecfb 100644
--- a/drivers/net/phy/cortina.c
+++ b/drivers/net/phy/cortina.c
@@ -174,7 +174,8 @@
 		printf("MMC read: dev # %u, block # %u, count %u ...\n",
 		       dev, blk, cnt);
 		mmc_init(mmc);
-		(void)mmc->block_dev.block_read(dev, blk, cnt, addr);
+		(void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
+						addr);
 		/* flush cache after read */
 		flush_cache((ulong)addr, cnt * 512);
 	}
diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c
index 20f5256..9fd10de 100644
--- a/fs/ext4/dev.c
+++ b/fs/ext4/dev.c
@@ -76,10 +76,10 @@
 	if (byte_offset != 0) {
 		int readlen;
 		/* read first part which isn't aligned with start of sector */
-		if (ext4fs_block_dev_desc->
-		    block_read(ext4fs_block_dev_desc->dev,
-				part_info->start + sector, 1,
-				(unsigned long *) sec_buf) != 1) {
+		if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
+						      part_info->start + sector,
+						      1, (void *)sec_buf)
+		    != 1) {
 			printf(" ** ext2fs_devread() read error **\n");
 			return 0;
 		}
@@ -101,18 +101,18 @@
 		ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_block_dev_desc->blksz);
 
 		block_len = ext4fs_block_dev_desc->blksz;
-		ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc->dev,
+		ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
 						  part_info->start + sector,
-						  1, (unsigned long *)p);
+						  1, (void *)p);
 		memcpy(buf, p, byte_len);
 		return 1;
 	}
 
-	if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc->dev,
-					       part_info->start + sector,
-					       block_len >> log2blksz,
-					       (unsigned long *) buf) !=
-					       block_len >> log2blksz) {
+	if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
+					      part_info->start + sector,
+					      block_len >> log2blksz,
+					      (void *)buf) !=
+					      block_len >> log2blksz) {
 		printf(" ** %s read error - block\n", __func__);
 		return 0;
 	}
@@ -123,10 +123,10 @@
 
 	if (byte_len != 0) {
 		/* read rest of data which are not in whole sector */
-		if (ext4fs_block_dev_desc->
-		    block_read(ext4fs_block_dev_desc->dev,
-				part_info->start + sector, 1,
-				(unsigned long *) sec_buf) != 1) {
+		if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
+						      part_info->start + sector,
+						      1, (void *)sec_buf)
+		    != 1) {
 			printf("* %s read error - last part\n", __func__);
 			return 0;
 		}
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index e73223a..55efa4d 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -82,26 +82,26 @@
 
 	if (remainder) {
 		if (fs->dev_desc->block_read) {
-			fs->dev_desc->block_read(fs->dev_desc->dev,
+			fs->dev_desc->block_read(fs->dev_desc,
 						 startblock, 1, sec_buf);
 			temp_ptr = sec_buf;
 			memcpy((temp_ptr + remainder),
 			       (unsigned char *)buf, size);
-			fs->dev_desc->block_write(fs->dev_desc->dev,
+			fs->dev_desc->block_write(fs->dev_desc,
 						  startblock, 1, sec_buf);
 		}
 	} else {
 		if (size >> log2blksz != 0) {
-			fs->dev_desc->block_write(fs->dev_desc->dev,
+			fs->dev_desc->block_write(fs->dev_desc,
 						  startblock,
 						  size >> log2blksz,
 						  (unsigned long *)buf);
 		} else {
-			fs->dev_desc->block_read(fs->dev_desc->dev,
+			fs->dev_desc->block_read(fs->dev_desc,
 						 startblock, 1, sec_buf);
 			temp_ptr = sec_buf;
 			memcpy(temp_ptr, buf, size);
-			fs->dev_desc->block_write(fs->dev_desc->dev,
+			fs->dev_desc->block_write(fs->dev_desc,
 						  startblock, 1,
 						  (unsigned long *)sec_buf);
 		}
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index f939bc5..472a63e 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -51,8 +51,8 @@
 	if (!cur_dev || !cur_dev->block_read)
 		return -1;
 
-	ret = cur_dev->block_read(cur_dev->dev,
-				  cur_part_info.start + block, nr_blocks, buf);
+	ret = cur_dev->block_read(cur_dev, cur_part_info.start + block,
+				  nr_blocks, buf);
 
 	if (nr_blocks && ret == 0)
 		return -1;
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index af828d0..5ed324c 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -41,8 +41,7 @@
 		return -1;
 	}
 
-	ret = cur_dev->block_write(cur_dev->dev,
-				   cur_part_info.start + block,
+	ret = cur_dev->block_write(cur_dev, cur_part_info.start + block,
 				   nr_blocks, buf);
 	if (nr_blocks && ret == 0)
 		return -1;
diff --git a/fs/reiserfs/dev.c b/fs/reiserfs/dev.c
index 6825545..7b24d6a 100644
--- a/fs/reiserfs/dev.c
+++ b/fs/reiserfs/dev.c
@@ -59,9 +59,11 @@
 
 	if (byte_offset != 0) {
 		/* read first part which isn't aligned with start of sector */
-		if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc->dev,
-		    part_info->start + sector, 1,
-		    (unsigned long *)sec_buf) != 1) {
+		if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
+							part_info->start +
+								sector,
+							1, (void *)sec_buf)
+		    != 1) {
 			printf (" ** reiserfs_devread() read error\n");
 			return 0;
 		}
@@ -73,9 +75,11 @@
 
 	/* read sector aligned part */
 	block_len = byte_len & ~(SECTOR_SIZE-1);
-	if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc->dev,
-	    part_info->start + sector, block_len/SECTOR_SIZE,
-	    (unsigned long *)buf) != block_len/SECTOR_SIZE) {
+	if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
+						part_info->start + sector,
+						block_len / SECTOR_SIZE,
+						(void *)buf)
+	    != block_len/SECTOR_SIZE) {
 		printf (" ** reiserfs_devread() read error - block\n");
 		return 0;
 	}
@@ -85,9 +89,11 @@
 
 	if ( byte_len != 0 ) {
 		/* read rest of data which are not in whole sector */
-		if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc->dev,
-		    part_info->start + sector, 1,
-		    (unsigned long *)sec_buf) != 1) {
+		if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
+							part_info->start +
+							    sector,
+							1, (void *)sec_buf)
+		    != 1) {
 			printf (" ** reiserfs_devread() read error - last part\n");
 			return 0;
 		}
diff --git a/fs/zfs/dev.c b/fs/zfs/dev.c
index 3a1fa56..67d1265 100644
--- a/fs/zfs/dev.c
+++ b/fs/zfs/dev.c
@@ -55,9 +55,10 @@
 
 	if (byte_offset != 0) {
 		/* read first part which isn't aligned with start of sector */
-		if (zfs_block_dev_desc->block_read(zfs_block_dev_desc->dev,
-			part_info->start + sector, 1,
-			(unsigned long *)sec_buf) != 1) {
+		if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
+						   part_info->start + sector, 1,
+						   (void *)sec_buf)
+		    != 1) {
 			printf(" ** zfs_devread() read error **\n");
 			return 1;
 		}
@@ -78,16 +79,18 @@
 		u8 p[SECTOR_SIZE];
 
 		block_len = SECTOR_SIZE;
-		zfs_block_dev_desc->block_read(zfs_block_dev_desc->dev,
-			part_info->start + sector,
-			1, (unsigned long *)p);
+		zfs_block_dev_desc->block_read(zfs_block_dev_desc,
+					       part_info->start + sector,
+					       1, (void *)p);
 		memcpy(buf, p, byte_len);
 		return 0;
 	}
 
-	if (zfs_block_dev_desc->block_read(zfs_block_dev_desc->dev,
-		part_info->start + sector, block_len / SECTOR_SIZE,
-		(unsigned long *) buf) != block_len / SECTOR_SIZE) {
+	if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
+					   part_info->start + sector,
+					   block_len / SECTOR_SIZE,
+					   (void *)buf)
+	    != block_len / SECTOR_SIZE) {
 		printf(" ** zfs_devread() read error - block\n");
 		return 1;
 	}
@@ -99,10 +102,9 @@
 
 	if (byte_len != 0) {
 		/* read rest of data which are not in whole sector */
-		if (zfs_block_dev_desc->
-			block_read(zfs_block_dev_desc->dev,
-					   part_info->start + sector, 1,
-					   (unsigned long *) sec_buf) != 1) {
+		if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
+						   part_info->start + sector,
+						   1, (void *)sec_buf) != 1) {
 			printf(" ** zfs_devread() read error - last part\n");
 			return 1;
 		}
diff --git a/include/ide.h b/include/ide.h
index f9b43cb..f9357be 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -41,8 +41,10 @@
  */
 
 void ide_init(void);
-ulong ide_read(int device, lbaint_t blknr, lbaint_t blkcnt, void *buffer);
-ulong ide_write(int device, lbaint_t blknr, lbaint_t blkcnt,
+typedef struct block_dev_desc block_dev_desc_t;
+ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+	       void *buffer);
+ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
 		const void *buffer);
 
 #ifdef CONFIG_IDE_PREINIT
diff --git a/include/part.h b/include/part.h
index 720a867..8396ed1 100644
--- a/include/part.h
+++ b/include/part.h
@@ -10,7 +10,9 @@
 #include <ide.h>
 #include <common.h>
 
-typedef struct block_dev_desc {
+typedef struct block_dev_desc block_dev_desc_t;
+
+struct block_dev_desc {
 	int		if_type;	/* type of the interface */
 	int		dev;		/* device number */
 	unsigned char	part_type;	/* partition type */
@@ -27,19 +29,19 @@
 	char		vendor [40+1];	/* IDE model, SCSI Vendor */
 	char		product[20+1];	/* IDE Serial no, SCSI product */
 	char		revision[8+1];	/* firmware revision */
-	unsigned long	(*block_read)(int dev,
+	unsigned long	(*block_read)(block_dev_desc_t *block_dev,
 				      lbaint_t start,
 				      lbaint_t blkcnt,
 				      void *buffer);
-	unsigned long	(*block_write)(int dev,
+	unsigned long	(*block_write)(block_dev_desc_t *block_dev,
 				       lbaint_t start,
 				       lbaint_t blkcnt,
 				       const void *buffer);
-	unsigned long   (*block_erase)(int dev,
+	unsigned long	(*block_erase)(block_dev_desc_t *block_dev,
 				       lbaint_t start,
 				       lbaint_t blkcnt);
 	void		*priv;		/* driver private struct pointer */
-}block_dev_desc_t;
+};
 
 #define BLOCK_CNT(size, block_dev_desc) (PAD_COUNT(size, block_dev_desc->blksz))
 #define PAD_TO_BLOCKSIZE(size, block_dev_desc) \
diff --git a/lib/gunzip.c b/lib/gunzip.c
index bdd85c4..d86aa87 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -231,8 +231,7 @@
 			gzwrite_progress(iteration++,
 					 totalfilled,
 					 szexpected);
-			blocks_written = dev->block_write(dev->dev,
-							  outblock,
+			blocks_written = dev->block_write(dev, outblock,
 							  writeblocks,
 							  writebuf);
 			outblock += blocks_written;
diff --git a/test/dm/usb.c b/test/dm/usb.c
index cbc7899..3a2e52b 100644
--- a/test/dm/usb.c
+++ b/test/dm/usb.c
@@ -50,7 +50,7 @@
 	/* Read a few blocks and look for the string we expect */
 	ut_asserteq(512, dev_desc->blksz);
 	memset(cmp, '\0', sizeof(cmp));
-	ut_asserteq(2, dev_desc->block_read(dev_desc->dev, 0, 2, cmp));
+	ut_asserteq(2, dev_desc->block_read(dev_desc, 0, 2, cmp));
 	ut_assertok(strcmp(cmp, "this is a test"));
 
 	return 0;
