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>
diff --git a/drivers/virtio/virtio_blk.c b/drivers/virtio/virtio_blk.c
index 3ff74f4..9710b79 100644
--- a/drivers/virtio/virtio_blk.c
+++ b/drivers/virtio/virtio_blk.c
@@ -75,14 +75,14 @@
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;