if (!blk_enabled())
return NULL;
- dev_desc = blk_get_devnum_by_typename(ifname, dev);
+ dev_desc = blk_get_devnum_by_uclass_idname(ifname, dev);
if (!dev_desc) {
debug("%s: No device for iface '%s', dev %d\n", __func__,
ifname, dev);
return;
}
- switch (dev_desc->if_type) {
+ switch (dev_desc->uclass_id) {
case UCLASS_SCSI:
printf ("(%d:%d) Vendor: %s Prod.: %s Rev: %s\n",
dev_desc->target,dev_desc->lun,
case UCLASS_USB:
case UCLASS_NVME:
case UCLASS_PVBLOCK:
- case UCLASS_ROOT:
+ case UCLASS_HOST:
printf ("Vendor: %s Rev: %s Prod: %s\n",
dev_desc->vendor,
dev_desc->revision,
puts("device type unknown\n");
return;
default:
- printf("Unhandled device type: %i\n", dev_desc->if_type);
+ printf("Unhandled device type: %i\n", dev_desc->uclass_id);
return;
}
puts (" Type: ");
const int n_ents = ll_entry_count(struct part_driver, part_driver);
struct part_driver *entry;
- blkcache_invalidate(dev_desc->if_type, dev_desc->devnum);
+ blkcache_invalidate(dev_desc->uclass_id, dev_desc->devnum);
dev_desc->part_type = PART_TYPE_UNKNOWN;
for (entry = drv; entry != drv + n_ents; entry++) {
CONFIG_IS_ENABLED(AMIGA_PARTITION) || \
CONFIG_IS_ENABLED(EFI_PARTITION)
puts ("\nPartition Map for ");
- switch (dev_desc->if_type) {
+ switch (dev_desc->uclass_id) {
case UCLASS_IDE:
puts ("IDE");
break;
case UCLASS_MMC:
puts ("MMC");
break;
- case UCLASS_ROOT:
+ case UCLASS_HOST:
puts ("HOST");
break;
case UCLASS_NVME:
* Always should be done, otherwise hw partition 0 will return
* stale data after displaying a non-zero hw partition.
*/
- if ((*dev_desc)->if_type == UCLASS_MMC)
+ if ((*dev_desc)->uclass_id == UCLASS_MMC)
part_init(*dev_desc);
}
int part;
struct disk_partition tmpinfo;
+ *dev_desc = NULL;
+ memset(info, 0, sizeof(*info));
+
#if IS_ENABLED(CONFIG_SANDBOX) || IS_ENABLED(CONFIG_SEMIHOSTING)
/*
* Special-case a pseudo block device "hostfs", to allow access to the
* host's own filesystem.
*/
- if (0 == strcmp(ifname, "hostfs")) {
- *dev_desc = NULL;
- info->start = 0;
- info->size = 0;
- info->blksz = 0;
- info->bootable = 0;
+ if (!strcmp(ifname, "hostfs")) {
strcpy((char *)info->type, BOOT_PART_TYPE);
strcpy((char *)info->name, "Host filesystem");
-#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
- info->uuid[0] = 0;
-#endif
-#ifdef CONFIG_PARTITION_TYPE_GUID
- info->type_guid[0] = 0;
-#endif
return 0;
}
* Special-case ubi, ubi goes through a mtd, rather than through
* a regular block device.
*/
- if (0 == strcmp(ifname, "ubi")) {
+ if (!strcmp(ifname, "ubi")) {
if (!ubifs_is_mounted()) {
printf("UBIFS not mounted, use ubifsmount to mount volume first!\n");
return -EINVAL;
}
- *dev_desc = NULL;
- memset(info, 0, sizeof(*info));
strcpy((char *)info->type, BOOT_PART_TYPE);
strcpy((char *)info->name, "UBI");
-#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
- info->uuid[0] = 0;
-#endif
return 0;
}
#endif
{
char *devtype;
- switch (dev_desc->if_type) {
+ switch (dev_desc->uclass_id) {
case UCLASS_IDE:
case UCLASS_AHCI:
devtype = "hd";