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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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); */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user