aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass2022-08-11 19:34:59 -0600
committerTom Rini2022-09-16 11:05:16 -0400
commite33a5c6be55e7c012b2851f9bdf90e7f607e72bf (patch)
tree19041e9f1b54a5d2811c96e88132ba44fe31243b /drivers
parentadbfe8edc3389ba635229195a95217d8b0dfa182 (diff)
blk: Switch over to using uclass IDs
We currently have an if_type (interface type) and a uclass id. These are closely related and we don't need to have both. Drop the if_type values and use the uclass ones instead. Maintain the existing, subtle, one-way conversion between UCLASS_USB and UCLASS_MASS_STORAGE for now, and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/dwc_ahsata.c2
-rw-r--r--drivers/ata/fsl_sata.c2
-rw-r--r--drivers/ata/sata.c2
-rw-r--r--drivers/ata/sata_mv.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/block/blk-uclass.c64
-rw-r--r--drivers/block/efi_blk.c2
-rw-r--r--drivers/block/ide.c8
-rw-r--r--drivers/block/sandbox.c12
-rw-r--r--drivers/dfu/dfu_mmc.c6
-rw-r--r--drivers/mmc/mmc-uclass.c10
-rw-r--r--drivers/mmc/mmc_legacy.c6
-rw-r--r--drivers/mmc/mmc_write.c4
-rw-r--r--drivers/nvme/nvme.c2
-rw-r--r--drivers/scsi/scsi.c10
-rw-r--r--drivers/tee/optee/rpmb.c4
-rw-r--r--drivers/virtio/virtio_blk.c4
-rw-r--r--drivers/xen/pvblock.c6
18 files changed, 77 insertions, 71 deletions
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c
index 1a2c3c2fe70..167b5a395f5 100644
--- a/drivers/ata/dwc_ahsata.c
+++ b/drivers/ata/dwc_ahsata.c
@@ -880,7 +880,7 @@ int dwc_ahsata_scan(struct udevice *dev)
device_find_first_child(dev, &blk);
if (!blk) {
ret = blk_create_devicef(dev, "dwc_ahsata_blk", "blk",
- IF_TYPE_SATA, -1, 512, 0, &blk);
+ UCLASS_AHCI, -1, 512, 0, &blk);
if (ret) {
debug("Can't create device\n");
return ret;
diff --git a/drivers/ata/fsl_sata.c b/drivers/ata/fsl_sata.c
index 6db4247368e..972101b29ce 100644
--- a/drivers/ata/fsl_sata.c
+++ b/drivers/ata/fsl_sata.c
@@ -888,7 +888,7 @@ static int fsl_ata_probe(struct udevice *dev)
for (i = 0; i < nr_ports; i++) {
snprintf(sata_name, sizeof(sata_name), "fsl_sata%d", i);
ret = blk_create_devicef(dev, "sata_fsl_blk", sata_name,
- IF_TYPE_SATA, -1, 512, 0, &blk);
+ UCLASS_AHCI, -1, 512, 0, &blk);
if (ret) {
debug("Can't create device\n");
return ret;
diff --git a/drivers/ata/sata.c b/drivers/ata/sata.c
index 0e6c8cdd422..604c721cfdc 100644
--- a/drivers/ata/sata.c
+++ b/drivers/ata/sata.c
@@ -79,7 +79,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].if_type = UCLASS_AHCI;
sata_dev_desc[i].devnum = i;
sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
sata_dev_desc[i].type = DEV_TYPE_HARDDISK;
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index a187796dfcd..18c7a66db1b 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1076,7 +1076,7 @@ static int sata_mv_probe(struct udevice *dev)
for (i = 0; i < nr_ports; i++) {
ret = blk_create_devicef(dev, "sata_mv_blk", "blk",
- IF_TYPE_SATA, -1, 512, 0, &blk);
+ UCLASS_AHCI, -1, 512, 0, &blk);
if (ret) {
debug("Can't create device\n");
continue;
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index 70651545722..b5e150d568b 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -730,7 +730,7 @@ static int sil_pci_probe(struct udevice *dev)
for (i = sata_info.portbase; i < sata_info.maxport; i++) {
snprintf(sata_name, sizeof(sata_name), "sil_sata%d", i);
ret = blk_create_devicef(dev, "sata_sil_blk", sata_name,
- IF_TYPE_SATA, -1, 512, 0, &blk);
+ UCLASS_AHCI, -1, 512, 0, &blk);
if (ret) {
debug("Can't create device\n");
return ret;
diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c
index a68158c3f25..436af764f91 100644
--- a/drivers/block/blk-uclass.c
+++ b/drivers/block/blk-uclass.c
@@ -21,31 +21,17 @@ static struct {
enum uclass_id id;
const char *name;
} if_typename_str[] = {
- { IF_TYPE_IDE, "ide" },
- { IF_TYPE_SCSI, "scsi" },
- { IF_TYPE_USB, "usb" },
- { IF_TYPE_MMC, "mmc" },
- { IF_TYPE_SCSI, "sata" },
- { IF_TYPE_HOST, "host" },
- { IF_TYPE_NVME, "nvme" },
- { IF_TYPE_EFI_MEDIA, "efi" },
- { IF_TYPE_EFI_LOADER, "efiloader" },
- { IF_TYPE_VIRTIO, "virtio" },
- { IF_TYPE_PVBLOCK, "pvblock" },
-};
-
-static enum uclass_id if_type_uclass_id[IF_TYPE_COUNT] = {
- [IF_TYPE_IDE] = UCLASS_IDE,
- [IF_TYPE_SCSI] = UCLASS_SCSI,
- [IF_TYPE_USB] = UCLASS_MASS_STORAGE,
- [IF_TYPE_MMC] = UCLASS_MMC,
- [IF_TYPE_SATA] = UCLASS_AHCI,
- [IF_TYPE_HOST] = UCLASS_ROOT,
- [IF_TYPE_NVME] = UCLASS_NVME,
- [IF_TYPE_EFI_MEDIA] = UCLASS_EFI_MEDIA,
- [IF_TYPE_EFI_LOADER] = UCLASS_EFI_LOADER,
- [IF_TYPE_VIRTIO] = UCLASS_VIRTIO,
- [IF_TYPE_PVBLOCK] = UCLASS_PVBLOCK,
+ { UCLASS_IDE, "ide" },
+ { UCLASS_SCSI, "scsi" },
+ { UCLASS_USB, "usb" },
+ { UCLASS_MMC, "mmc" },
+ { UCLASS_AHCI, "sata" },
+ { UCLASS_ROOT, "host" },
+ { UCLASS_NVME, "nvme" },
+ { UCLASS_EFI_MEDIA, "efi" },
+ { UCLASS_EFI_LOADER, "efiloader" },
+ { UCLASS_VIRTIO, "virtio" },
+ { UCLASS_PVBLOCK, "pvblock" },
};
static enum if_type if_typename_to_iftype(const char *if_typename)
@@ -57,12 +43,32 @@ static enum if_type if_typename_to_iftype(const char *if_typename)
return if_typename_str[i].id;
}
- return IF_TYPE_UNKNOWN;
+ return UCLASS_INVALID;
}
static enum uclass_id if_type_to_uclass_id(enum if_type if_type)
{
- return if_type_uclass_id[if_type];
+ /*
+ * This strange adjustment is used because we use UCLASS_MASS_STORAGE
+ * for USB storage devices, so need to return this as the uclass to
+ * use for USB. In fact USB_UCLASS is for USB controllers, not
+ * peripherals.
+ *
+ * The name of the UCLASS_MASS_STORAGE uclass driver is
+ * "usb_mass_storage", but we want to use "usb" in things like the
+ * 'part list' command and when showing interfaces.
+ *
+ * So for now we have this one-way conversion.
+ *
+ * The fix for this is possibly to:
+ * - rename UCLASS_MASS_STORAGE name to "usb"
+ * - rename UCLASS_USB name to "usb_ctlr"
+ * - use UCLASS_MASS_STORAGE instead of UCLASS_USB in if_typename_str
+ */
+ if (if_type == UCLASS_USB)
+ return UCLASS_MASS_STORAGE;
+
+ return if_type;
}
const char *blk_get_if_type_name(enum if_type if_type)
@@ -70,7 +76,7 @@ const char *blk_get_if_type_name(enum if_type if_type)
int i;
for (i = 0; i < ARRAY_SIZE(if_typename_str); i++) {
- if ((int)if_typename_str[i].id == if_type)
+ if (if_typename_str[i].id == if_type)
return if_typename_str[i].name;
}
@@ -105,7 +111,7 @@ struct blk_desc *blk_get_devnum_by_typename(const char *if_typename, int devnum)
int ret;
type = if_typename_to_iftype(if_typename);
- if (type == IF_TYPE_UNKNOWN) {
+ if (type == UCLASS_INVALID) {
debug("%s: Unknown interface type '%s'\n", __func__,
if_typename);
return NULL;
diff --git a/drivers/block/efi_blk.c b/drivers/block/efi_blk.c
index 9d25ecbf37f..917a19f6025 100644
--- a/drivers/block/efi_blk.c
+++ b/drivers/block/efi_blk.c
@@ -94,7 +94,7 @@ static int efi_media_bind(struct udevice *dev)
struct udevice *blk;
int ret;
- ret = blk_create_devicef(dev, "efi_block", "blk", IF_TYPE_EFI_MEDIA,
+ ret = blk_create_devicef(dev, "efi_block", "blk", UCLASS_EFI_MEDIA,
dev_seq(dev), plat->blkio->media->block_size,
plat->blkio->media->last_block, &blk);
if (ret) {
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index 6bc48e3402e..73da29ad552 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -537,7 +537,7 @@ static void ide_ident(struct blk_desc *dev_desc)
/* Select device
*/
ide_outb(device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
- dev_desc->if_type = IF_TYPE_IDE;
+ dev_desc->if_type = UCLASS_IDE;
#ifdef CONFIG_ATAPI
retries = 0;
@@ -752,7 +752,7 @@ void ide_init(void)
for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; ++i) {
ide_dev_desc[i].type = DEV_TYPE_UNKNOWN;
- ide_dev_desc[i].if_type = IF_TYPE_IDE;
+ ide_dev_desc[i].if_type = UCLASS_IDE;
ide_dev_desc[i].devnum = i;
ide_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
ide_dev_desc[i].blksz = 0;
@@ -1110,7 +1110,7 @@ static int ide_probe(struct udevice *udev)
if (!blksz)
continue;
ret = blk_create_devicef(udev, "ide_blk", name,
- IF_TYPE_IDE, i,
+ UCLASS_IDE, i,
blksz, size, &blk_dev);
if (ret)
return ret;
@@ -1144,7 +1144,7 @@ UCLASS_DRIVER(ide) = {
#else
U_BOOT_LEGACY_BLK(ide) = {
.if_typename = "ide",
- .if_type = IF_TYPE_IDE,
+ .if_type = UCLASS_IDE,
.max_devs = CONFIG_SYS_IDE_MAXDEVICE,
.desc = ide_dev_desc,
};
diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c
index 1388498a1d3..2de12e0a93e 100644
--- a/drivers/block/sandbox.c
+++ b/drivers/block/sandbox.c
@@ -98,7 +98,7 @@ int host_dev_bind(int devnum, char *filename, bool removable)
int ret, fd;
/* Remove and unbind the old device, if any */
- ret = blk_get_device(IF_TYPE_HOST, devnum, &dev);
+ ret = blk_get_device(UCLASS_ROOT, devnum, &dev);
if (ret == 0) {
ret = device_remove(dev, DM_REMOVE_NORMAL);
if (ret)
@@ -135,7 +135,7 @@ int host_dev_bind(int devnum, char *filename, bool removable)
}
}
ret = blk_create_device(gd->dm_root, "sandbox_host_blk", str,
- IF_TYPE_HOST, devnum, 512,
+ UCLASS_ROOT, devnum, 512,
os_lseek(fd, 0, OS_SEEK_END) / 512, &dev);
if (ret)
goto err_file;
@@ -150,7 +150,7 @@ int host_dev_bind(int devnum, char *filename, bool removable)
goto err_file;
}
- desc = blk_get_devnum_by_type(IF_TYPE_HOST, devnum);
+ desc = blk_get_devnum_by_type(UCLASS_ROOT, devnum);
desc->removable = removable;
snprintf(desc->vendor, BLK_VEN_SIZE, "U-Boot");
snprintf(desc->product, BLK_PRD_SIZE, "hostfile");
@@ -192,7 +192,7 @@ int host_dev_bind(int dev, char *filename, bool removable)
}
struct blk_desc *blk_dev = &host_dev->blk_dev;
- blk_dev->if_type = IF_TYPE_HOST;
+ blk_dev->if_type = UCLASS_ROOT;
blk_dev->priv = host_dev;
blk_dev->blksz = 512;
blk_dev->lba = os_lseek(host_dev->fd, 0, OS_SEEK_END) / blk_dev->blksz;
@@ -216,7 +216,7 @@ int host_get_dev_err(int devnum, struct blk_desc **blk_devp)
struct udevice *dev;
int ret;
- ret = blk_get_device(IF_TYPE_HOST, devnum, &dev);
+ ret = blk_get_device(UCLASS_ROOT, devnum, &dev);
if (ret)
return ret;
*blk_devp = dev_get_uclass_plat(dev);
@@ -263,7 +263,7 @@ U_BOOT_DRIVER(sandbox_host_blk) = {
#else
U_BOOT_LEGACY_BLK(sandbox_host) = {
.if_typename = "host",
- .if_type = IF_TYPE_HOST,
+ .if_type = UCLASS_ROOT,
.max_devs = SANDBOX_HOST_MAX_DEVICES,
.get_dev = host_get_dev_err,
};
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index a91da972d46..f5832083ba1 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -52,7 +52,7 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
if (dfu->data.mmc.hw_partition >= 0) {
part_num_bkp = mmc_get_blk_desc(mmc)->hwpart;
- ret = blk_select_hwpart_devnum(IF_TYPE_MMC,
+ ret = blk_select_hwpart_devnum(UCLASS_MMC,
dfu->data.mmc.dev_num,
dfu->data.mmc.hw_partition);
if (ret)
@@ -77,14 +77,14 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
if (n != blk_count) {
pr_err("MMC operation failed");
if (dfu->data.mmc.hw_partition >= 0)
- blk_select_hwpart_devnum(IF_TYPE_MMC,
+ blk_select_hwpart_devnum(UCLASS_MMC,
dfu->data.mmc.dev_num,
part_num_bkp);
return -EIO;
}
if (dfu->data.mmc.hw_partition >= 0) {
- ret = blk_select_hwpart_devnum(IF_TYPE_MMC,
+ ret = blk_select_hwpart_devnum(UCLASS_MMC,
dfu->data.mmc.dev_num,
part_num_bkp);
if (ret)
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 688bdc06d42..b1bd4ae1bc8 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -290,7 +290,7 @@ struct mmc *find_mmc_device(int dev_num)
struct udevice *dev, *mmc_dev;
int ret;
- ret = blk_find_device(IF_TYPE_MMC, dev_num, &dev);
+ ret = blk_find_device(UCLASS_MMC, dev_num, &dev);
if (ret) {
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
@@ -308,12 +308,12 @@ struct mmc *find_mmc_device(int dev_num)
int get_mmc_num(void)
{
- return max((blk_find_max_devnum(IF_TYPE_MMC) + 1), 0);
+ return max((blk_find_max_devnum(UCLASS_MMC) + 1), 0);
}
int mmc_get_next_devnum(void)
{
- return blk_find_max_devnum(IF_TYPE_MMC);
+ return blk_find_max_devnum(UCLASS_MMC);
}
int mmc_get_blk(struct udevice *dev, struct udevice **blkp)
@@ -411,8 +411,8 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg)
/* Use the fixed index with aliases node's index */
debug("%s: alias devnum=%d\n", __func__, dev_seq(dev));
- ret = blk_create_devicef(dev, "mmc_blk", "blk", IF_TYPE_MMC,
- dev_seq(dev), 512, 0, &bdev);
+ ret = blk_create_devicef(dev, "mmc_blk", "blk", UCLASS_MMC,
+ dev_seq(dev), 512, 0, &bdev);
if (ret) {
debug("Cannot create block device\n");
return ret;
diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
index a05da6c2e88..4e0891e5dfe 100644
--- a/drivers/mmc/mmc_legacy.c
+++ b/drivers/mmc/mmc_legacy.c
@@ -132,7 +132,7 @@ static struct mmc mmc_static = {
.dsr_imp = 0,
.dsr = 0xffffffff,
.block_dev = {
- .if_type = IF_TYPE_MMC,
+ .if_type = UCLASS_MMC,
.removable = 1,
.devnum = 0,
.block_read = mmc_bread,
@@ -194,7 +194,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 */
bdesc = mmc_get_blk_desc(mmc);
- bdesc->if_type = IF_TYPE_MMC;
+ bdesc->if_type = UCLASS_MMC;
bdesc->removable = 1;
bdesc->devnum = mmc_get_next_devnum();
bdesc->block_read = mmc_bread;
@@ -254,7 +254,7 @@ static int mmc_get_dev(int dev, struct blk_desc **descp)
U_BOOT_LEGACY_BLK(mmc) = {
.if_typename = "mmc",
- .if_type = IF_TYPE_MMC,
+ .if_type = UCLASS_MMC,
.max_devs = -1,
.get_dev = mmc_get_dev,
.select_hwpart = mmc_select_hwpartp,
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
index eab94c7b607..5b7aeeb0121 100644
--- a/drivers/mmc/mmc_write.c
+++ b/drivers/mmc/mmc_write.c
@@ -85,7 +85,7 @@ ulong mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt)
if (!mmc)
return -1;
- err = blk_select_hwpart_devnum(IF_TYPE_MMC, dev_num,
+ err = blk_select_hwpart_devnum(UCLASS_MMC, dev_num,
block_dev->hwpart);
if (err < 0)
return -1;
@@ -203,7 +203,7 @@ ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
if (!mmc)
return 0;
- err = blk_select_hwpart_devnum(IF_TYPE_MMC, dev_num, block_dev->hwpart);
+ err = blk_select_hwpart_devnum(UCLASS_MMC, dev_num, block_dev->hwpart);
if (err < 0)
return 0;
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index 31cf7006330..3510f797e00 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -880,7 +880,7 @@ int nvme_init(struct udevice *udev)
sprintf(name, "blk#%d", i);
/* The real blksz and size will be set by nvme_blk_probe() */
- ret = blk_create_devicef(udev, "nvme-blk", name, IF_TYPE_NVME,
+ ret = blk_create_devicef(udev, "nvme-blk", name, UCLASS_NVME,
-1, 512, 0, &ns_udev);
if (ret)
goto free_id;
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 78d729d809d..99be5aef877 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -456,7 +456,7 @@ static void scsi_init_dev_desc(struct blk_desc *dev_desc, int devnum)
{
dev_desc->lba = 0;
dev_desc->blksz = 0;
- dev_desc->if_type = IF_TYPE_SCSI;
+ dev_desc->if_type = UCLASS_SCSI;
dev_desc->devnum = devnum;
dev_desc->part_type = PART_TYPE_UNKNOWN;
@@ -574,8 +574,8 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)
* block devices created
*/
snprintf(str, sizeof(str), "id%dlun%d", id, lun);
- ret = blk_create_devicef(dev, "scsi_blk", str, IF_TYPE_SCSI, -1,
- bd.blksz, bd.lba, &bdev);
+ ret = blk_create_devicef(dev, "scsi_blk", str, UCLASS_SCSI, -1,
+ bd.blksz, bd.lba, &bdev);
if (ret) {
debug("Can't create device\n");
return ret;
@@ -638,7 +638,7 @@ int scsi_scan(bool verbose)
if (verbose)
printf("scanning bus for devices...\n");
- blk_unbind_all(IF_TYPE_SCSI);
+ blk_unbind_all(UCLASS_SCSI);
ret = uclass_get(UCLASS_SCSI, &uc);
if (ret)
@@ -707,7 +707,7 @@ U_BOOT_DRIVER(scsi_blk) = {
#else
U_BOOT_LEGACY_BLK(scsi) = {
.if_typename = "scsi",
- .if_type = IF_TYPE_SCSI,
+ .if_type = UCLASS_SCSI,
.max_devs = SCSI_MAX_DEVICE,
.desc = scsi_dev_desc,
};
diff --git a/drivers/tee/optee/rpmb.c b/drivers/tee/optee/rpmb.c
index cf5e0a08e61..5bc13757ea8 100644
--- a/drivers/tee/optee/rpmb.c
+++ b/drivers/tee/optee/rpmb.c
@@ -48,7 +48,7 @@ static void release_mmc(struct optee_private *priv)
if (!priv->rpmb_mmc)
return;
- rc = blk_select_hwpart_devnum(IF_TYPE_MMC, priv->rpmb_dev_id,
+ rc = blk_select_hwpart_devnum(UCLASS_MMC, priv->rpmb_dev_id,
priv->rpmb_original_part);
if (rc)
debug("%s: blk_select_hwpart_devnum() failed: %d\n",
@@ -88,7 +88,7 @@ static struct mmc *get_mmc(struct optee_private *priv, int dev_id)
priv->rpmb_original_part = mmc_get_blk_desc(mmc)->hwpart;
- rc = blk_select_hwpart_devnum(IF_TYPE_MMC, dev_id, MMC_PART_RPMB);
+ rc = blk_select_hwpart_devnum(UCLASS_MMC, dev_id, MMC_PART_RPMB);
if (rc) {
debug("Device id %d: cannot select RPMB partition: %d\n",
dev_id, rc);
diff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c
index 3ff74f4a975..9710b79117c 100644
--- a/drivers/virtio/virtio_blk.c
+++ b/drivers/virtio/virtio_blk.c
@@ -75,14 +75,14 @@ static int virtio_blk_bind(struct udevice *dev)
struct blk_desc *desc = dev_get_uclass_plat(dev);
int devnum;
- desc->if_type = IF_TYPE_VIRTIO;
+ desc->if_type = UCLASS_VIRTIO;
/*
* Initialize the devnum to -ENODEV. This is to make sure that
* blk_next_free_devnum() works as expected, since the default
* value 0 is a valid devnum.
*/
desc->devnum = -ENODEV;
- devnum = blk_next_free_devnum(IF_TYPE_VIRTIO);
+ devnum = blk_next_free_devnum(UCLASS_VIRTIO);
if (devnum < 0)
return devnum;
desc->devnum = devnum;
diff --git a/drivers/xen/pvblock.c b/drivers/xen/pvblock.c
index c25c3ea4fff..1090e528d02 100644
--- a/drivers/xen/pvblock.c
+++ b/drivers/xen/pvblock.c
@@ -665,14 +665,14 @@ static int pvblock_blk_bind(struct udevice *udev)
struct blk_desc *desc = dev_get_uclass_plat(udev);
int devnum;
- desc->if_type = IF_TYPE_PVBLOCK;
+ desc->if_type = UCLASS_PVBLOCK;
/*
* Initialize the devnum to -ENODEV. This is to make sure that
* blk_next_free_devnum() works as expected, since the default
* value 0 is a valid devnum.
*/
desc->devnum = -ENODEV;
- devnum = blk_next_free_devnum(IF_TYPE_PVBLOCK);
+ devnum = blk_next_free_devnum(UCLASS_PVBLOCK);
if (devnum < 0)
return devnum;
desc->devnum = devnum;
@@ -804,7 +804,7 @@ static void print_pvblock_devices(void)
const char *class_name;
class_name = uclass_get_name(UCLASS_PVBLOCK);
- for (blk_first_device(IF_TYPE_PVBLOCK, &udev); udev;
+ for (blk_first_device(UCLASS_PVBLOCK, &udev); udev;
blk_next_device(&udev), first = false) {
struct blk_desc *desc = dev_get_uclass_plat(udev);