]> git.sur5r.net Git - u-boot/commitdiff
dm: block: Rename device number member dev to devnum
authorSimon Glass <sjg@chromium.org>
Mon, 29 Feb 2016 22:25:51 +0000 (15:25 -0700)
committerSimon Glass <sjg@chromium.org>
Mon, 14 Mar 2016 21:34:50 +0000 (15:34 -0600)
This is a device number, and we want to use 'dev' to mean a driver model
device. Rename the member.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
28 files changed:
board/sunxi/board.c
cmd/disk.c
cmd/fat.c
cmd/ide.c
cmd/mmc_spi.c
cmd/reiser.c
cmd/sata.c
cmd/scsi.c
cmd/usb_mass_storage.c
cmd/zfs.c
common/env_fat.c
common/fb_mmc.c
common/usb_storage.c
disk/part.c
disk/part_dos.c
disk/part_efi.c
disk/part_iso.c
disk/part_mac.c
drivers/block/sandbox.c
drivers/block/systemace.c
drivers/mmc/arm_pl180_mmci.c
drivers/mmc/mmc.c
drivers/mmc/mmc_write.c
drivers/mmc/mxsmmc.c
drivers/mmc/omap_hsmmc.c
drivers/mmc/sdhci.c
fs/fat/fat.c
include/blk.h

index 15b7af634cb275b48bd308e0b52c433407624bac..80eae9cd48a635495089698924c9c0f5721b9bbf 100644 (file)
@@ -337,8 +337,8 @@ int board_mmc_init(bd_t *bis)
        if (!sunxi_mmc_has_egon_boot_signature(mmc0) &&
            sunxi_mmc_has_egon_boot_signature(mmc1)) {
                /* Booting from emmc / mmc2, swap */
-               mmc0->block_dev.dev = 1;
-               mmc1->block_dev.dev = 0;
+               mmc0->block_dev.devnum = 1;
+               mmc1->block_dev.devnum = 0;
        }
 #endif
 
index 0883c79506cd44adad9cef839a5b1f58977b88a1..27ed115d2f55f28f880f5e78dfde875004d29c16 100644 (file)
@@ -45,7 +45,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
                return 1;
        }
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
        bootstage_mark(BOOTSTAGE_ID_IDE_TYPE);
 
        printf("\nLoading from %s device %d, partition %d: "
index 18a1be97e0a4ded538e9efbb0cd04d315b39aa5d..4e207462d93e9a1301d32b2a379e29149251a351 100644 (file)
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -81,7 +81,7 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
        if (part < 0)
                return 1;
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
        if (fat_set_blk_dev(dev_desc, &info) != 0) {
                printf("\n** Unable to use %s %d:%d for fatinfo **\n",
                        argv[1], dev, part);
@@ -118,7 +118,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
        if (part < 0)
                return 1;
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
 
        if (fat_set_blk_dev(dev_desc, &info) != 0) {
                printf("\n** Unable to use %s %d:%d for fatwrite **\n",
index 01b91b5fbdb7d0beda8f4e591b3edc9a2c0b1889..dfd55480b7c56d75315d6350d48e6ce07dd5f8cc 100644 (file)
--- a/cmd/ide.c
+++ b/cmd/ide.c
@@ -418,7 +418,7 @@ void ide_init(void)
                int led = (IDE_BUS(i) == 0) ? LED_IDE1 : LED_IDE2;
                ide_dev_desc[i].type = DEV_TYPE_UNKNOWN;
                ide_dev_desc[i].if_type = IF_TYPE_IDE;
-               ide_dev_desc[i].dev = i;
+               ide_dev_desc[i].devnum = i;
                ide_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
                ide_dev_desc[i].blksz = 0;
                ide_dev_desc[i].log2blksz =
@@ -551,7 +551,7 @@ static void ide_ident(struct blk_desc *dev_desc)
 #endif
        int device;
 
-       device = dev_desc->dev;
+       device = dev_desc->devnum;
        printf("  Device %d: ", device);
 
        ide_led(DEVICE_LED(device), 1); /* LED on       */
@@ -716,7 +716,7 @@ static void ide_ident(struct blk_desc *dev_desc)
 ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
               void *buffer)
 {
-       int device = block_dev->dev;
+       int device = block_dev->devnum;
        ulong n = 0;
        unsigned char c;
        unsigned char pwrsave = 0;      /* power save */
@@ -842,7 +842,7 @@ IDE_READ_E:
 ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
                const void *buffer)
 {
-       int device = block_dev->dev;
+       int device = block_dev->devnum;
        ulong n = 0;
        unsigned char c;
 
@@ -1308,7 +1308,7 @@ static void atapi_inquiry(struct blk_desc *dev_desc)
        unsigned char c;
        int device;
 
-       device = dev_desc->dev;
+       device = dev_desc->devnum;
        dev_desc->type = DEV_TYPE_UNKNOWN;      /* not yet valid */
        dev_desc->block_read = atapi_read;
 
@@ -1397,7 +1397,7 @@ static void atapi_inquiry(struct blk_desc *dev_desc)
 ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
                 void *buffer)
 {
-       int device = block_dev->dev;
+       int device = block_dev->devnum;
        ulong n = 0;
        unsigned char ccb[12];  /* Command descriptor block */
        ulong cnt;
index a2138b8650e90cc68a1c2dde5b808fe9caa7dc47..0c44d0681784e67c6d4ac4bc690a314b0e35781f 100644 (file)
@@ -72,8 +72,8 @@ static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                printf("Failed to create MMC Device\n");
                return 1;
        }
-       printf("%s: %d at %u:%u hz %u mode %u\n", mmc->cfg->name, mmc->block_dev.dev,
-              bus, cs, speed, mode);
+       printf("%s: %d at %u:%u hz %u mode %u\n", mmc->cfg->name,
+              mmc->block_dev.devnum, bus, cs, speed, mode);
        mmc_init(mmc);
        return 0;
 
index a7179561e4a7fe144adb4f0ee640c42bcd372703..cbdad36da074e818a80d15f1de1926781d3906db 100644 (file)
@@ -48,7 +48,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
            filename = argv[3];
        }
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
        PRINTF("Using device %s %d:%d, directory: %s\n", argv[1], dev, part, filename);
 
        reiserfs_set_blk_dev(dev_desc, &info);
@@ -126,7 +126,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (part < 0)
                return 1;
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
 
        printf("Loading file \"%s\" from %s device %d%c%c\n",
                filename, argv[1], dev,
index 8b1f19ce4744e9dc9d4dbeb510957d1131582fd0..c8de9a3f83103ce919b140ad6c7f39e02691316e 100644 (file)
@@ -21,13 +21,13 @@ struct blk_desc sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
 static unsigned long sata_bread(struct blk_desc *block_dev, lbaint_t start,
                                lbaint_t blkcnt, void *dst)
 {
-       return sata_read(block_dev->dev, start, blkcnt, dst);
+       return sata_read(block_dev->devnum, start, blkcnt, dst);
 }
 
 static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start,
                                 lbaint_t blkcnt, const void *buffer)
 {
-       return sata_write(block_dev->dev, start, blkcnt, buffer);
+       return sata_write(block_dev->devnum, start, blkcnt, buffer);
 }
 
 int __sata_initialize(void)
@@ -38,7 +38,7 @@ int __sata_initialize(void)
        for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
                memset(&sata_dev_desc[i], 0, sizeof(struct blk_desc));
                sata_dev_desc[i].if_type = IF_TYPE_SATA;
-               sata_dev_desc[i].dev = i;
+               sata_dev_desc[i].devnum = i;
                sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
                sata_dev_desc[i].type = DEV_TYPE_HARDDISK;
                sata_dev_desc[i].lba = 0;
index de0651c41945bd8e4de366fd0cfc29967385ec45..951d1e5cfb5b617971293e42d2b446caea277ef4 100644 (file)
@@ -99,7 +99,7 @@ void scsi_scan(int mode)
                scsi_dev_desc[i].revision[0]=0;
                scsi_dev_desc[i].removable = false;
                scsi_dev_desc[i].if_type=IF_TYPE_SCSI;
-               scsi_dev_desc[i].dev=i;
+               scsi_dev_desc[i].devnum = i;
                scsi_dev_desc[i].part_type=PART_TYPE_UNKNOWN;
                scsi_dev_desc[i].block_read=scsi_read;
                scsi_dev_desc[i].block_write = scsi_write;
@@ -379,7 +379,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
                       lbaint_t blkcnt, void *buffer)
 {
-       int device = block_dev->dev;
+       int device = block_dev->devnum;
        lbaint_t start, blks;
        uintptr_t buf_addr;
        unsigned short smallblks = 0;
@@ -446,7 +446,7 @@ static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
 static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
                        lbaint_t blkcnt, const void *buffer)
 {
-       int device = block_dev->dev;
+       int device = block_dev->devnum;
        lbaint_t start, blks;
        uintptr_t buf_addr;
        unsigned short smallblks;
index 59bb4ee5ec8cdf5ae0fb4790bd1842008e724100..14eed980df90ca0d931a9b83493c0b56d9024335 100644 (file)
@@ -100,7 +100,7 @@ static int ums_init(const char *devtype, const char *devnums)
                ums[ums_count].block_dev = *block_dev;
 
                printf("UMS: LUN %d, dev %d, hwpart %d, sector %#x, count %#x\n",
-                      ums_count, ums[ums_count].block_dev.dev,
+                      ums_count, ums[ums_count].block_dev.devnum,
                       ums[ums_count].block_dev.hwpart,
                       ums[ums_count].start_sector,
                       ums[ums_count].num_sectors);
index bb61afd80decf2aa26e9eff12745be538088c3de..93067a990a9afc2c04c284719263bebbd3b852c7 100644 (file)
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -84,7 +84,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
        if (part < 0)
                return 1;
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
        printf("Loading file \"%s\" from %s device %d%c%c\n",
                filename, argv[1], dev,
                part ? ':' : ' ', part ? part + '0' : ' ');
index 2f2271035557edf41db89647fdd0aee21ac7d4f8..75616d4c5b5c8a00d8415c15a63776520435d8a5 100644 (file)
@@ -54,7 +54,7 @@ int saveenv(void)
        if (part < 0)
                return 1;
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
        if (fat_set_blk_dev(dev_desc, &info) != 0) {
                printf("\n** Unable to use %s %d:%d for saveenv **\n",
                       FAT_ENV_INTERFACE, dev, part);
@@ -88,7 +88,7 @@ void env_relocate_spec(void)
        if (part < 0)
                goto err_env_relocate;
 
-       dev = dev_desc->dev;
+       dev = dev_desc->devnum;
        if (fat_set_blk_dev(dev_desc, &info) != 0) {
                printf("\n** Unable to use %s %d:%d for loading the env **\n",
                       FAT_ENV_INTERFACE, dev, part);
index d5c91351a7206b33b6be62e42e59b95bac19a9fa..da7949f6f03239e8cf5b223d2354a1a1191c7f4d 100644 (file)
@@ -86,7 +86,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
 
        blks = dev_desc->block_write(dev_desc, info->start, blkcnt, buffer);
        if (blks != blkcnt) {
-               error("failed writing to device %d\n", dev_desc->dev);
+               error("failed writing to device %d\n", dev_desc->devnum);
                fastboot_fail(response_str, "failed writing to device");
                return;
        }
@@ -207,7 +207,7 @@ void fb_mmc_erase(const char *cmd, char *response)
 
        blks = dev_desc->block_erase(dev_desc, blks_start, blks_size);
        if (blks != blks_size) {
-               error("failed erasing from device %d", dev_desc->dev);
+               error("failed erasing from device %d", dev_desc->devnum);
                fastboot_fail(response_str, "failed erasing from device");
                return;
        }
index e105a95d691d0f60a204002ee408a4745870055b..60531e2aa486e33e83bc54dfbdcb021acdce9e0a 100644 (file)
@@ -192,7 +192,7 @@ static int usb_stor_probe_device(struct usb_device *dev)
                        blkdev = &usb_dev_desc[usb_max_devs];
                        memset(blkdev, '\0', sizeof(struct blk_desc));
                        blkdev->if_type = IF_TYPE_USB;
-                       blkdev->dev = usb_max_devs;
+                       blkdev->devnum = usb_max_devs;
                        blkdev->part_type = PART_TYPE_UNKNOWN;
                        blkdev->target = 0xff;
                        blkdev->type = DEV_TYPE_UNKNOWN;
@@ -1029,7 +1029,7 @@ static void usb_bin_fixup(struct usb_device_descriptor descriptor,
 static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
                                   lbaint_t blkcnt, void *buffer)
 {
-       int device = block_dev->dev;
+       int device = block_dev->devnum;
        lbaint_t start, blks;
        uintptr_t buf_addr;
        unsigned short smallblks;
@@ -1100,7 +1100,7 @@ retry_it:
 static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
                                    lbaint_t blkcnt, const void *buffer)
 {
-       int device = block_dev->dev;
+       int device = block_dev->devnum;
        lbaint_t start, blks;
        uintptr_t buf_addr;
        unsigned short smallblks;
index 9a78cceadbc77971146882fc3a17fd13d0460c33..2a460503922cda45f8c9546178375d945c59c956 100644 (file)
@@ -108,7 +108,7 @@ static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
                                return dev_desc;
                        if (!select_hwpart)
                                return NULL;
-                       ret = select_hwpart(dev_desc->dev, hwpart);
+                       ret = select_hwpart(dev_desc->devnum, hwpart);
                        if (ret < 0)
                                return NULL;
                        return dev_desc;
@@ -325,7 +325,7 @@ static void print_part_header(const char *type, struct blk_desc *dev_desc)
                break;
        }
        printf (" device %d  --   Partition Type: %s\n\n",
-                       dev_desc->dev, type);
+                       dev_desc->devnum, type);
 #endif /* any CONFIG_..._PARTITION */
 }
 
@@ -457,10 +457,6 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
        int part;
        disk_partition_t tmpinfo;
 
-#if defined CONFIG_SANDBOX && defined CONFIG_CMD_UBIFS
-#error Only one of CONFIG_SANDBOX and CONFIG_CMD_UBIFS may be selected
-#endif
-
 #ifdef CONFIG_SANDBOX
        /*
         * Special-case a pseudo block device "hostfs", to allow access to the
index 4a56391de7e821b8bdf10e4e3178e85cbc0a8811..5f8d949b84c7a680c33ce29e296ea0174cf87727 100644 (file)
@@ -114,7 +114,7 @@ static void print_partition_extended(struct blk_desc *dev_desc,
        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);
+                       dev_desc->devnum, ext_part_sector);
                return;
        }
        i=test_block_type(buffer);
@@ -180,7 +180,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc,
        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);
+                       dev_desc->devnum, ext_part_sector);
                return -1;
        }
        if (buffer[DOS_PART_MAGIC_OFFSET] != 0x55 ||
@@ -215,24 +215,29 @@ static int part_get_info_extended(struct blk_desc *dev_desc,
                                case IF_TYPE_IDE:
                                case IF_TYPE_SATA:
                                case IF_TYPE_ATAPI:
-                                       sprintf ((char *)info->name, "hd%c%d",
-                                               'a' + dev_desc->dev, part_num);
+                                       sprintf((char *)info->name, "hd%c%d",
+                                               'a' + dev_desc->devnum,
+                                               part_num);
                                        break;
                                case IF_TYPE_SCSI:
-                                       sprintf ((char *)info->name, "sd%c%d",
-                                               'a' + dev_desc->dev, part_num);
+                                       sprintf((char *)info->name, "sd%c%d",
+                                               'a' + dev_desc->devnum,
+                                               part_num);
                                        break;
                                case IF_TYPE_USB:
-                                       sprintf ((char *)info->name, "usbd%c%d",
-                                               'a' + dev_desc->dev, part_num);
+                                       sprintf((char *)info->name, "usbd%c%d",
+                                               'a' + dev_desc->devnum,
+                                               part_num);
                                        break;
                                case IF_TYPE_DOC:
-                                       sprintf ((char *)info->name, "docd%c%d",
-                                               'a' + dev_desc->dev, part_num);
+                                       sprintf((char *)info->name, "docd%c%d",
+                                               'a' + dev_desc->devnum,
+                                               part_num);
                                        break;
                                default:
-                                       sprintf ((char *)info->name, "xx%c%d",
-                                               'a' + dev_desc->dev, part_num);
+                                       sprintf((char *)info->name, "xx%c%d",
+                                               'a' + dev_desc->devnum,
+                                               part_num);
                                        break;
                        }
                        /* sprintf(info->type, "%d, pt->sys_ind); */
index 209a671d3eed7f3af337817495ec90a601691874..ae8cd7ea584a88d38e658267e2a356516bd74160 100644 (file)
@@ -356,7 +356,7 @@ static int set_protective_mbr(struct blk_desc *dev_desc)
        /* Write MBR sector to the MMC device */
        if (dev_desc->block_write(dev_desc, 0, 1, p_mbr) != 1) {
                printf("** Can't write to device %d **\n",
-                       dev_desc->dev);
+                       dev_desc->devnum);
                return -1;
        }
 
@@ -410,7 +410,7 @@ int write_gpt_table(struct blk_desc *dev_desc,
        return 0;
 
  err:
-       printf("** Can't write to device %d **\n", dev_desc->dev);
+       printf("** Can't write to device %d **\n", dev_desc->devnum);
        return -1;
 }
 
index a1cf358388ae314c700062c085f74bc70ed87cf6..c78ae21bf32ca83e2650cf4612ace70f2a87029b 100644 (file)
@@ -68,13 +68,13 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
        if(ppr->desctype!=0x01) {
                if(verb)
                        printf ("** First descriptor is NOT a primary desc on %d:%d **\n",
-                               dev_desc->dev, part_num);
+                               dev_desc->devnum, part_num);
                return (-1);
        }
        if(strncmp((char *)ppr->stand_ident,"CD001",5)!=0) {
                if(verb)
                        printf ("** Wrong ISO Ident: %s on %d:%d **\n",
-                               ppr->stand_ident,dev_desc->dev, part_num);
+                               ppr->stand_ident, dev_desc->devnum, part_num);
                return (-1);
        }
        lastsect= ((ppr->firstsek_LEpathtab1_LE & 0x000000ff)<<24) +
@@ -92,7 +92,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
                if(ppr->desctype==0xff) {
                        if(verb)
                                printf ("** No valid boot catalog found on %d:%d **\n",
-                                       dev_desc->dev, part_num);
+                                       dev_desc->devnum, part_num);
                        return (-1);
                }
        }
@@ -100,7 +100,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
        if(strncmp(pbr->ident_str,"EL TORITO SPECIFICATION",23)!=0) {
                if(verb)
                        printf ("** Wrong El Torito ident: %s on %d:%d **\n",
-                               pbr->ident_str,dev_desc->dev, part_num);
+                               pbr->ident_str, dev_desc->devnum, part_num);
                return (-1);
        }
        bootaddr=le32_to_int(pbr->pointer);
@@ -108,7 +108,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
        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);
+                               bootaddr, dev_desc->devnum, part_num);
                return (-1);
        }
        chksum=0;
@@ -117,21 +117,21 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
                chksum+=((chksumbuf[i] &0xff)<<8)+((chksumbuf[i] &0xff00)>>8);
        if(chksum!=0) {
                if(verb)
-                       printf ("** Checksum Error in booting catalog validation entry on %d:%d **\n",
-                               dev_desc->dev, part_num);
+                       printf("** Checksum Error in booting catalog validation entry on %d:%d **\n",
+                              dev_desc->devnum, part_num);
                return (-1);
        }
        if((pve->key[0]!=0x55)||(pve->key[1]!=0xAA)) {
                if(verb)
                        printf ("** Key 0x55 0xAA error on %d:%d **\n",
-                               dev_desc->dev, part_num);
+                               dev_desc->devnum, part_num);
                return(-1);
        }
 #ifdef CHECK_FOR_POWERPC_PLATTFORM
        if(pve->platform!=0x01) {
                if(verb)
                        printf ("** No PowerPC platform CD on %d:%d **\n",
-                               dev_desc->dev, part_num);
+                               dev_desc->devnum, part_num);
                return(-1);
        }
 #endif
@@ -144,23 +144,23 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
                case IF_TYPE_SATA:
                case IF_TYPE_ATAPI:
                        sprintf ((char *)info->name, "hd%c%d",
-                               'a' + dev_desc->dev, part_num);
+                               'a' + dev_desc->devnum, part_num);
                        break;
                case IF_TYPE_SCSI:
                        sprintf ((char *)info->name, "sd%c%d",
-                               'a' + dev_desc->dev, part_num);
+                               'a' + dev_desc->devnum, part_num);
                        break;
                case IF_TYPE_USB:
                        sprintf ((char *)info->name, "usbd%c%d",
-                               'a' + dev_desc->dev, part_num);
+                               'a' + dev_desc->devnum, part_num);
                        break;
                case IF_TYPE_DOC:
                        sprintf ((char *)info->name, "docd%c%d",
-                               'a' + dev_desc->dev, part_num);
+                               'a' + dev_desc->devnum, part_num);
                        break;
                default:
                        sprintf ((char *)info->name, "xx%c%d",
-                               'a' + dev_desc->dev, part_num);
+                               'a' + dev_desc->devnum, part_num);
                        break;
        }
        /* the bootcatalog (including validation Entry) is limited to 2048Bytes
@@ -184,7 +184,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
                else {
                        if(verb)
                                printf ("** Partition %d not found on device %d **\n",
-                                       part_num,dev_desc->dev);
+                                       part_num, dev_desc->devnum);
                        return(-1);
                }
        }
@@ -192,13 +192,13 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
         * searched w/o succsess */
        if(verb)
                printf ("** Partition %d not found on device %d **\n",
-                       part_num,dev_desc->dev);
+                       part_num, dev_desc->devnum);
        return(-1);
 found:
        if(pide->boot_ind!=0x88) {
                if(verb)
-                       printf ("** Partition %d is not bootable on device %d **\n",
-                               part_num,dev_desc->dev);
+                       printf("** Partition %d is not bootable on device %d **\n",
+                              part_num, dev_desc->devnum);
                return (-1);
        }
        switch(pide->boot_media) {
@@ -229,7 +229,8 @@ static void print_part_iso(struct blk_desc *dev_desc)
        int i;
 
        if (part_get_info_iso_verb(dev_desc, 0, &info, 0) == -1) {
-               printf("** No boot partition found on device %d **\n",dev_desc->dev);
+               printf("** No boot partition found on device %d **\n",
+                      dev_desc->devnum);
                return;
        }
        printf("Part   Start     Sect x Size Type\n");
index 61927234fb8e231fd2a44e3e54906fe579e8e1a0..07bbc1988ae6973cdcb682975a8d0c5ed8ae30c2 100644 (file)
@@ -108,14 +108,14 @@ static void print_part_mac(struct blk_desc *dev_desc)
                printf ("%4ld: ", i);
                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);
+                               dev_desc->devnum, i);
                        return;
                }
 
                if (mpart->signature != MAC_PARTITION_MAGIC) {
-                       printf ("** Bad Signature on %d:%ld - "
-                               "expected 0x%04x, got 0x%04x\n",
-                               dev_desc->dev, i, MAC_PARTITION_MAGIC, mpart->signature);
+                       printf("** Bad Signature on %d:%ld - expected 0x%04x, got 0x%04x\n",
+                              dev_desc->devnum, i, MAC_PARTITION_MAGIC,
+                              mpart->signature);
                        return;
                }
 
@@ -184,14 +184,14 @@ static int part_mac_read_pdb(struct blk_desc *dev_desc, int part,
                 */
                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);
+                               dev_desc->devnum, n);
                        return (-1);
                }
 
                if (pdb_p->signature != MAC_PARTITION_MAGIC) {
-                       printf ("** Bad Signature on %d:%d: "
-                               "expected 0x%04x, got 0x%04x\n",
-                               dev_desc->dev, n, MAC_PARTITION_MAGIC, pdb_p->signature);
+                       printf("** Bad Signature on %d:%d: expected 0x%04x, got 0x%04x\n",
+                              dev_desc->devnum, n, MAC_PARTITION_MAGIC,
+                              pdb_p->signature);
                        return (-1);
                }
 
@@ -200,9 +200,9 @@ static int part_mac_read_pdb(struct blk_desc *dev_desc, int part,
 
                if ((part < 1) || (part > pdb_p->map_count)) {
                        printf ("** Invalid partition %d:%d [%d:1...%d:%d only]\n",
-                               dev_desc->dev, part,
-                               dev_desc->dev,
-                               dev_desc->dev, pdb_p->map_count);
+                               dev_desc->devnum, part,
+                               dev_desc->devnum,
+                               dev_desc->devnum, pdb_p->map_count);
                        return (-1);
                }
 
index 093e133992dc6a4b232cd16ec35a7f08cedc3975..14d3e38ef2035fbd1d5778a262714327b795de3b 100644 (file)
@@ -26,7 +26,7 @@ static unsigned long host_block_read(struct blk_desc *block_dev,
                                     unsigned long start, lbaint_t blkcnt,
                                     void *buffer)
 {
-       int dev = block_dev->dev;
+       int dev = block_dev->devnum;
        struct host_block_dev *host_dev = find_host_device(dev);
 
        if (!host_dev)
@@ -48,7 +48,7 @@ static unsigned long host_block_write(struct blk_desc *block_dev,
                                      unsigned long start, lbaint_t blkcnt,
                                      const void *buffer)
 {
-       int dev = block_dev->dev;
+       int dev = block_dev->devnum;
        struct host_block_dev *host_dev = find_host_device(dev);
        if (os_lseek(host_dev->fd,
                     start * host_dev->blk_dev.blksz,
@@ -96,7 +96,7 @@ int host_dev_bind(int dev, char *filename)
        blk_dev->lba = os_lseek(host_dev->fd, 0, OS_SEEK_END) / blk_dev->blksz;
        blk_dev->block_read = host_block_read;
        blk_dev->block_write = host_block_write;
-       blk_dev->dev = dev;
+       blk_dev->devnum = dev;
        blk_dev->part_type = PART_TYPE_UNKNOWN;
        part_init(blk_dev);
 
index b921dcd206630edc6622baa8df6b3e1b4d4ac7bb..09fe834e2270ef8c765e12d111d91b31ad11ab83 100644 (file)
@@ -111,7 +111,7 @@ struct blk_desc *systemace_get_dev(int dev)
           not yet initialized. In that case, fill it in. */
        if (systemace_dev.blksz == 0) {
                systemace_dev.if_type = IF_TYPE_UNKNOWN;
-               systemace_dev.dev = 0;
+               systemace_dev.devnum = 0;
                systemace_dev.part_type = PART_TYPE_UNKNOWN;
                systemace_dev.type = DEV_TYPE_HARDDISK;
                systemace_dev.blksz = 512;
index 5ef7ff7ff2b7fa584c36d64e8f9f530f43cd7425..8f2694f14c0a7caa703511d6848d1c03138db649 100644 (file)
@@ -375,7 +375,7 @@ int arm_pl180_mmci_init(struct pl180_mmc_host *host)
        if (mmc == NULL)
                return -1;
 
-       debug("registered mmc interface number is:%d\n", mmc->block_dev.dev);
+       debug("registered mmc interface number is:%d\n", mmc->block_dev.devnum);
 
        return 0;
 }
index 94afbb105ee50a3e4505715493592646bebf48d9..8b2e6069ea012b6a6e419e1e42a807e647697089 100644 (file)
@@ -182,7 +182,7 @@ struct mmc *find_mmc_device(int dev_num)
        list_for_each(entry, &mmc_devices) {
                m = list_entry(entry, struct mmc, link);
 
-               if (m->block_dev.dev == dev_num)
+               if (m->block_dev.devnum == dev_num)
                        return m;
        }
 
@@ -237,7 +237,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
 static ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start,
                       lbaint_t blkcnt, void *dst)
 {
-       int dev_num = block_dev->dev;
+       int dev_num = block_dev->devnum;
        int err;
        lbaint_t cur, blocks_todo = blkcnt;
 
@@ -1556,7 +1556,7 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
        mmc->dsr = 0xffffffff;
        /* Setup the universal parts of the block interface just once */
        mmc->block_dev.if_type = IF_TYPE_MMC;
-       mmc->block_dev.dev = cur_dev_num++;
+       mmc->block_dev.devnum = cur_dev_num++;
        mmc->block_dev.removable = 1;
        mmc->block_dev.block_read = mmc_bread;
        mmc->block_dev.block_write = mmc_bwrite;
@@ -1728,7 +1728,7 @@ void print_mmc_devices(char separator)
                else
                        mmc_type = NULL;
 
-               printf("%s: %d", m->cfg->name, m->block_dev.dev);
+               printf("%s: %d", m->cfg->name, m->block_dev.devnum);
                if (mmc_type)
                        printf(" (%s)", mmc_type);
 
index 54e60dbe9c4c21339b92d840bc133f3a69be20a7..7b186f8500d70c754b8237519c498741447e1f78 100644 (file)
@@ -68,7 +68,7 @@ err_out:
 unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
                         lbaint_t blkcnt)
 {
-       int dev_num = block_dev->dev;
+       int dev_num = block_dev->devnum;
        int err = 0;
        u32 start_rem, blkcnt_rem;
        struct mmc *mmc = find_mmc_device(dev_num);
@@ -174,7 +174,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
 ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
                 const void *src)
 {
-       int dev_num = block_dev->dev;
+       int dev_num = block_dev->devnum;
        lbaint_t cur, blocks_todo = blkcnt;
        int err;
 
index 31fb3abc9c9ac36f0e53ee5a45bc7c9848c41dcd..9fa87d57173f685984528070bf2fd762caf3bb46 100644 (file)
@@ -142,7 +142,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
        uint32_t ctrl0;
        int ret;
 
-       debug("MMC%d: CMD%d\n", mmc->block_dev.dev, cmd->cmdidx);
+       debug("MMC%d: CMD%d\n", mmc->block_dev.devnum, cmd->cmdidx);
 
        /* Check bus busy */
        timeout = MXSMMC_MAX_TIMEOUT;
@@ -157,13 +157,13 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
        }
 
        if (!timeout) {
-               printf("MMC%d: Bus busy timeout!\n", mmc->block_dev.dev);
+               printf("MMC%d: Bus busy timeout!\n", mmc->block_dev.devnum);
                return TIMEOUT;
        }
 
        /* See if card is present */
        if (!mxsmmc_cd(priv)) {
-               printf("MMC%d: No card detected!\n", mmc->block_dev.dev);
+               printf("MMC%d: No card detected!\n", mmc->block_dev.devnum);
                return NO_CARD_ERR;
        }
 
@@ -200,9 +200,9 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
                if (data->flags & MMC_DATA_READ) {
                        ctrl0 |= SSP_CTRL0_READ;
                } else if (priv->mmc_is_wp &&
-                       priv->mmc_is_wp(mmc->block_dev.dev)) {
+                       priv->mmc_is_wp(mmc->block_dev.devnum)) {
                        printf("MMC%d: Can not write a locked card!\n",
-                               mmc->block_dev.dev);
+                               mmc->block_dev.devnum);
                        return UNUSABLE_ERR;
                }
 
@@ -243,21 +243,21 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 
        if (!timeout) {
                printf("MMC%d: Command %d busy\n",
-                       mmc->block_dev.dev, cmd->cmdidx);
+                       mmc->block_dev.devnum, cmd->cmdidx);
                return TIMEOUT;
        }
 
        /* Check command timeout */
        if (reg & SSP_STATUS_RESP_TIMEOUT) {
                printf("MMC%d: Command %d timeout (status 0x%08x)\n",
-                       mmc->block_dev.dev, cmd->cmdidx, reg);
+                       mmc->block_dev.devnum, cmd->cmdidx, reg);
                return TIMEOUT;
        }
 
        /* Check command errors */
        if (reg & (SSP_STATUS_RESP_CRC_ERR | SSP_STATUS_RESP_ERR)) {
                printf("MMC%d: Command %d error (status 0x%08x)!\n",
-                       mmc->block_dev.dev, cmd->cmdidx, reg);
+                       mmc->block_dev.devnum, cmd->cmdidx, reg);
                return COMM_ERR;
        }
 
@@ -279,14 +279,14 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
                if (ret) {
                        printf("MMC%d: Data timeout with command %d "
                                "(status 0x%08x)!\n",
-                               mmc->block_dev.dev, cmd->cmdidx, reg);
+                               mmc->block_dev.devnum, cmd->cmdidx, reg);
                        return ret;
                }
        } else {
                ret = mxsmmc_send_cmd_dma(priv, data);
                if (ret) {
                        printf("MMC%d: DMA transfer failed\n",
-                               mmc->block_dev.dev);
+                               mmc->block_dev.devnum);
                        return ret;
                }
        }
@@ -297,7 +297,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
                (SSP_STATUS_TIMEOUT | SSP_STATUS_DATA_CRC_ERR |
                SSP_STATUS_FIFO_OVRFLW | SSP_STATUS_FIFO_UNDRFLW)) {
                printf("MMC%d: Data error with command %d (status 0x%08x)!\n",
-                       mmc->block_dev.dev, cmd->cmdidx, reg);
+                       mmc->block_dev.devnum, cmd->cmdidx, reg);
                return COMM_ERR;
        }
 
@@ -330,7 +330,7 @@ static void mxsmmc_set_ios(struct mmc *mmc)
                        SSP_CTRL0_BUS_WIDTH_MASK, priv->buswidth);
 
        debug("MMC%d: Set %d bits bus width\n",
-               mmc->block_dev.dev, mmc->bus_width);
+               mmc->block_dev.devnum, mmc->bus_width);
 }
 
 static int mxsmmc_init(struct mmc *mmc)
index 5038a9f55f3d1e69a59fbfb17dabc3deddc79e13..5f2db3b5cfb2050e6c80202cf1b97ee444fa000d 100644 (file)
@@ -177,11 +177,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
 
 #if defined(CONFIG_OMAP44XX) && defined(CONFIG_TWL6030_POWER)
        /* PBIAS config needed for MMC1 only */
-       if (mmc->block_dev.dev == 0)
+       if (mmc->block_dev.devnum == 0)
                omap4_vmmc_pbias_config(mmc);
 #endif
 #if defined(CONFIG_OMAP54XX) && defined(CONFIG_PALMAS_POWER)
-       if (mmc->block_dev.dev == 0)
+       if (mmc->block_dev.devnum == 0)
                omap5_pbias_config(mmc);
 #endif
 
index 8586d898fdded663fb43a4386b07fd73142568d6..ef7e6150f9339d74ab6b51a17b918d0dbbda5196 100644 (file)
@@ -137,7 +137,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
        int trans_bytes = 0, is_aligned = 1;
        u32 mask, flags, mode;
        unsigned int time = 0, start_addr = 0;
-       int mmc_dev = mmc->block_dev.dev;
+       int mmc_dev = mmc->block_dev.devnum;
        unsigned start = get_timer(0);
 
        /* Timeout unit - ms */
index 47f077d4acd8d41870160800824867dcb1e923ac..f87ddd7630c8e6e948ea20d5fba6740cc3dd62b0 100644 (file)
@@ -100,7 +100,7 @@ int fat_register_device(struct blk_desc *dev_desc, int part_no)
        if (part_get_info(dev_desc, part_no, &info)) {
                if (part_no != 0) {
                        printf("** Partition %d not valid on device %d **\n",
-                                       part_no, dev_desc->dev);
+                                       part_no, dev_desc->devnum);
                        return -1;
                }
 
@@ -1284,7 +1284,7 @@ int file_fat_detectfs(void)
                printf("Unknown");
        }
 
-       printf("\n  Device %d: ", cur_dev->dev);
+       printf("\n  Device %d: ", cur_dev->devnum);
        dev_print(cur_dev);
 #endif
 
index fd545202eb4f8ae3cd7539950c764a5d1f729f34..9c54842961f3e3a99abf2c3574104a2f8e6d7eb3 100644 (file)
@@ -36,7 +36,7 @@ enum if_type {
 
 struct blk_desc {
        enum if_type    if_type;        /* type of the interface */
-       int             dev;            /* device number */
+       int             devnum;         /* device number */
        unsigned char   part_type;      /* partition type */
        unsigned char   target;         /* target SCSI ID */
        unsigned char   lun;            /* target LUN */