part: iso: Use desc instead of dev_desc

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the iso code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-08-24 13:55:28 -06:00 committed by Tom Rini
parent 7ed781fb4c
commit 06e293ed7c

View file

@ -46,7 +46,7 @@ unsigned long iso_dread(struct blk_desc *block_dev, lbaint_t start,
} }
/* only boot records will be listed as valid partitions */ /* only boot records will be listed as valid partitions */
int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num, int part_get_info_iso_verb(struct blk_desc *desc, int part_num,
struct disk_partition *info, int verb) struct disk_partition *info, int verb)
{ {
int i,offset,entry_num; int i,offset,entry_num;
@ -58,23 +58,23 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
iso_val_entry_t *pve = (iso_val_entry_t *)tmpbuf; iso_val_entry_t *pve = (iso_val_entry_t *)tmpbuf;
iso_init_def_entry_t *pide; iso_init_def_entry_t *pide;
if ((dev_desc->blksz != CD_SECTSIZE) && (dev_desc->blksz != 512)) if (desc->blksz != CD_SECTSIZE && desc->blksz != 512)
return -1; return -1;
/* the first sector (sector 0x10) must be a primary volume desc */ /* the first sector (sector 0x10) must be a primary volume desc */
blkaddr=PVD_OFFSET; blkaddr=PVD_OFFSET;
if (iso_dread(dev_desc, PVD_OFFSET, 1, (ulong *)tmpbuf) != 1) if (iso_dread(desc, PVD_OFFSET, 1, (ulong *)tmpbuf) != 1)
return -1; return -1;
if(ppr->desctype!=0x01) { if(ppr->desctype!=0x01) {
if(verb) if(verb)
printf ("** First descriptor is NOT a primary desc on %d:%d **\n", printf ("** First descriptor is NOT a primary desc on %d:%d **\n",
dev_desc->devnum, part_num); desc->devnum, part_num);
return (-1); return (-1);
} }
if(strncmp((char *)ppr->stand_ident,"CD001",5)!=0) { if(strncmp((char *)ppr->stand_ident,"CD001",5)!=0) {
if(verb) if(verb)
printf ("** Wrong ISO Ident: %s on %d:%d **\n", printf ("** Wrong ISO Ident: %s on %d:%d **\n",
ppr->stand_ident, dev_desc->devnum, part_num); ppr->stand_ident, desc->devnum, part_num);
return (-1); return (-1);
} }
lastsect = le32_to_cpu(ppr->firstsek_LEpathtab1_LE); lastsect = le32_to_cpu(ppr->firstsek_LEpathtab1_LE);
@ -83,14 +83,14 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
PRINTF(" Lastsect:%08lx\n",lastsect); PRINTF(" Lastsect:%08lx\n",lastsect);
for(i=blkaddr;i<lastsect;i++) { for(i=blkaddr;i<lastsect;i++) {
PRINTF("Reading block %d\n", i); PRINTF("Reading block %d\n", i);
if (iso_dread(dev_desc, i, 1, (ulong *)tmpbuf) != 1) if (iso_dread(desc, i, 1, (ulong *)tmpbuf) != 1)
return -1; return -1;
if(ppr->desctype==0x00) if(ppr->desctype==0x00)
break; /* boot entry found */ break; /* boot entry found */
if(ppr->desctype==0xff) { if(ppr->desctype==0xff) {
if(verb) if(verb)
printf ("** No valid boot catalog found on %d:%d **\n", printf ("** No valid boot catalog found on %d:%d **\n",
dev_desc->devnum, part_num); desc->devnum, part_num);
return (-1); return (-1);
} }
} }
@ -98,15 +98,15 @@ 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(strncmp(pbr->ident_str,"EL TORITO SPECIFICATION",23)!=0) {
if(verb) if(verb)
printf ("** Wrong El Torito ident: %s on %d:%d **\n", printf ("** Wrong El Torito ident: %s on %d:%d **\n",
pbr->ident_str, dev_desc->devnum, part_num); pbr->ident_str, desc->devnum, part_num);
return (-1); return (-1);
} }
bootaddr = get_unaligned_le32(pbr->pointer); bootaddr = get_unaligned_le32(pbr->pointer);
PRINTF(" Boot Entry at: %08lX\n",bootaddr); PRINTF(" Boot Entry at: %08lX\n",bootaddr);
if (iso_dread(dev_desc, bootaddr, 1, (ulong *)tmpbuf) != 1) { if (iso_dread(desc, bootaddr, 1, (ulong *)tmpbuf) != 1) {
if(verb) if(verb)
printf ("** Can't read Boot Entry at %lX on %d:%d **\n", printf ("** Can't read Boot Entry at %lX on %d:%d **\n",
bootaddr, dev_desc->devnum, part_num); bootaddr, desc->devnum, part_num);
return (-1); return (-1);
} }
chksum=0; chksum=0;
@ -116,20 +116,20 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
if(chksum!=0) { if(chksum!=0) {
if(verb) if(verb)
printf("** Checksum Error in booting catalog validation entry on %d:%d **\n", printf("** Checksum Error in booting catalog validation entry on %d:%d **\n",
dev_desc->devnum, part_num); desc->devnum, part_num);
return (-1); return (-1);
} }
if((pve->key[0]!=0x55)||(pve->key[1]!=0xAA)) { if((pve->key[0]!=0x55)||(pve->key[1]!=0xAA)) {
if(verb) if(verb)
printf ("** Key 0x55 0xAA error on %d:%d **\n", printf ("** Key 0x55 0xAA error on %d:%d **\n",
dev_desc->devnum, part_num); desc->devnum, part_num);
return(-1); return(-1);
} }
#ifdef CHECK_FOR_POWERPC_PLATTFORM #ifdef CHECK_FOR_POWERPC_PLATTFORM
if(pve->platform!=0x01) { if(pve->platform!=0x01) {
if(verb) if(verb)
printf ("** No PowerPC platform CD on %d:%d **\n", printf ("** No PowerPC platform CD on %d:%d **\n",
dev_desc->devnum, part_num); desc->devnum, part_num);
return(-1); return(-1);
} }
#endif #endif
@ -137,7 +137,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
entry_num=1; entry_num=1;
offset=0x20; offset=0x20;
strcpy((char *)info->type, "U-Boot"); strcpy((char *)info->type, "U-Boot");
part_set_generic_name(dev_desc, part_num, (char *)info->name); part_set_generic_name(desc, part_num, (char *)info->name);
/* the bootcatalog (including validation Entry) is limited to 2048Bytes /* the bootcatalog (including validation Entry) is limited to 2048Bytes
* (63 boot entries + validation entry) */ * (63 boot entries + validation entry) */
while(offset<2048) { while(offset<2048) {
@ -159,7 +159,7 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
else { else {
if(verb) if(verb)
printf ("** Partition %d not found on device %d **\n", printf ("** Partition %d not found on device %d **\n",
part_num, dev_desc->devnum); part_num, desc->devnum);
return(-1); return(-1);
} }
} }
@ -167,13 +167,13 @@ int part_get_info_iso_verb(struct blk_desc *dev_desc, int part_num,
* searched w/o succsess */ * searched w/o succsess */
if(verb) if(verb)
printf ("** Partition %d not found on device %d **\n", printf ("** Partition %d not found on device %d **\n",
part_num, dev_desc->devnum); part_num, desc->devnum);
return(-1); return(-1);
found: found:
if(pide->boot_ind!=0x88) { if(pide->boot_ind!=0x88) {
if(verb) if(verb)
printf("** Partition %d is not bootable on device %d **\n", printf("** Partition %d is not bootable on device %d **\n",
part_num, dev_desc->devnum); part_num, desc->devnum);
return (-1); return (-1);
} }
switch(pide->boot_media) { switch(pide->boot_media) {
@ -189,7 +189,7 @@ found:
newblkaddr = get_unaligned_le32(pide->rel_block_addr); newblkaddr = get_unaligned_le32(pide->rel_block_addr);
info->start=newblkaddr; info->start=newblkaddr;
if (dev_desc->blksz == 512) { if (desc->blksz == 512) {
info->size *= 4; info->size *= 4;
info->start *= 4; info->start *= 4;
info->blksz = 512; info->blksz = 512;
@ -199,20 +199,20 @@ found:
return 0; return 0;
} }
static int part_get_info_iso(struct blk_desc *dev_desc, int part_num, static int part_get_info_iso(struct blk_desc *desc, int part_num,
struct disk_partition *info) struct disk_partition *info)
{ {
return part_get_info_iso_verb(dev_desc, part_num, info, 0); return part_get_info_iso_verb(desc, part_num, info, 0);
} }
static void part_print_iso(struct blk_desc *dev_desc) static void part_print_iso(struct blk_desc *desc)
{ {
struct disk_partition info; struct disk_partition info;
int i; int i;
if (part_get_info_iso_verb(dev_desc, 1, &info, 0) == -1) { if (part_get_info_iso_verb(desc, 1, &info, 0) == -1) {
printf("** No boot partition found on device %d **\n", printf("** No boot partition found on device %d **\n",
dev_desc->devnum); desc->devnum);
return; return;
} }
printf("Part Start Sect x Size Type\n"); printf("Part Start Sect x Size Type\n");
@ -221,14 +221,14 @@ static void part_print_iso(struct blk_desc *dev_desc)
printf(" %2d %8" LBAFlength "u %8" LBAFlength "u %6ld %.32s\n", printf(" %2d %8" LBAFlength "u %8" LBAFlength "u %6ld %.32s\n",
i, info.start, info.size, info.blksz, info.type); i, info.start, info.size, info.blksz, info.type);
i++; i++;
} while (part_get_info_iso_verb(dev_desc, i, &info, 0) != -1); } while (part_get_info_iso_verb(desc, i, &info, 0) != -1);
} }
static int part_test_iso(struct blk_desc *dev_desc) static int part_test_iso(struct blk_desc *desc)
{ {
struct disk_partition info; struct disk_partition info;
return part_get_info_iso_verb(dev_desc, 1, &info, 0); return part_get_info_iso_verb(desc, 1, &info, 0);
} }
U_BOOT_PART_TYPE(iso) = { U_BOOT_PART_TYPE(iso) = {