From bcce53d048de7f41078d25e39aa2f26d752d3658 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 Feb 2016 15:25:51 -0700 Subject: dm: block: Rename device number member dev to devnum 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 Reviewed-by: Bin Meng Tested-by: Stephen Warren diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 15b7af6..80eae9c 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -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 diff --git a/cmd/disk.c b/cmd/disk.c index 0883c79..27ed115 100644 --- a/cmd/disk.c +++ b/cmd/disk.c @@ -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: " diff --git a/cmd/fat.c b/cmd/fat.c index 18a1be9..4e20746 100644 --- 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", diff --git a/cmd/ide.c b/cmd/ide.c index 01b91b5..dfd5548 100644 --- 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; diff --git a/cmd/mmc_spi.c b/cmd/mmc_spi.c index a2138b8..0c44d06 100644 --- a/cmd/mmc_spi.c +++ b/cmd/mmc_spi.c @@ -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; diff --git a/cmd/reiser.c b/cmd/reiser.c index a717956..cbdad36 100644 --- a/cmd/reiser.c +++ b/cmd/reiser.c @@ -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, diff --git a/cmd/sata.c b/cmd/sata.c index 8b1f19c..c8de9a3 100644 --- a/cmd/sata.c +++ b/cmd/sata.c @@ -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; diff --git a/cmd/scsi.c b/cmd/scsi.c index de0651c..951d1e5 100644 --- a/cmd/scsi.c +++ b/cmd/scsi.c @@ -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; diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c index 59bb4ee..14eed98 100644 --- a/cmd/usb_mass_storage.c +++ b/cmd/usb_mass_storage.c @@ -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); diff --git a/cmd/zfs.c b/cmd/zfs.c index bb61afd..93067a9 100644 --- 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' : ' '); diff --git a/common/env_fat.c b/common/env_fat.c index 2f22710..75616d4 100644 --- a/common/env_fat.c +++ b/common/env_fat.c @@ -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); diff --git a/common/fb_mmc.c b/common/fb_mmc.c index d5c9135..da7949f 100644 --- a/common/fb_mmc.c +++ b/common/fb_mmc.c @@ -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; } diff --git a/common/usb_storage.c b/common/usb_storage.c index e105a95..60531e2 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -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; diff --git a/disk/part.c b/disk/part.c index 9a78cce..2a46050 100644 --- a/disk/part.c +++ b/disk/part.c @@ -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 diff --git a/disk/part_dos.c b/disk/part_dos.c index 4a56391..5f8d949 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -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); */ diff --git a/disk/part_efi.c b/disk/part_efi.c index 209a671..ae8cd7e 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -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; } diff --git a/disk/part_iso.c b/disk/part_iso.c index a1cf358..c78ae21 100644 --- a/disk/part_iso.c +++ b/disk/part_iso.c @@ -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"); diff --git a/disk/part_mac.c b/disk/part_mac.c index 6192723..07bbc19 100644 --- a/disk/part_mac.c +++ b/disk/part_mac.c @@ -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); } diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c index 093e133..14d3e38 100644 --- a/drivers/block/sandbox.c +++ b/drivers/block/sandbox.c @@ -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); diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c index b921dcd..09fe834 100644 --- a/drivers/block/systemace.c +++ b/drivers/block/systemace.c @@ -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; diff --git a/drivers/mmc/arm_pl180_mmci.c b/drivers/mmc/arm_pl180_mmci.c index 5ef7ff7..8f2694f 100644 --- a/drivers/mmc/arm_pl180_mmci.c +++ b/drivers/mmc/arm_pl180_mmci.c @@ -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; } diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 94afbb1..8b2e606 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -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); diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c index 54e60db..7b186f8 100644 --- a/drivers/mmc/mmc_write.c +++ b/drivers/mmc/mmc_write.c @@ -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; diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c index 31fb3ab..9fa87d5 100644 --- a/drivers/mmc/mxsmmc.c +++ b/drivers/mmc/mxsmmc.c @@ -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) diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 5038a9f..5f2db3b 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -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 diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 8586d89..ef7e615 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -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 */ diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 47f077d..f87ddd7 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -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 diff --git a/include/blk.h b/include/blk.h index fd54520..9c54842 100644 --- a/include/blk.h +++ b/include/blk.h @@ -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 */ -- cgit v0.10.2