diff options
author | Simon Glass <sjg@chromium.org> | 2022-08-11 19:34:59 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-16 11:05:16 -0400 |
commit | e33a5c6be55e7c012b2851f9bdf90e7f607e72bf (patch) | |
tree | 19041e9f1b54a5d2811c96e88132ba44fe31243b /drivers/scsi/scsi.c | |
parent | adbfe8edc3389ba635229195a95217d8b0dfa182 (diff) | |
download | u-boot-e33a5c6be55e7c012b2851f9bdf90e7f607e72bf.zip u-boot-e33a5c6be55e7c012b2851f9bdf90e7f607e72bf.tar.gz u-boot-e33a5c6be55e7c012b2851f9bdf90e7f607e72bf.tar.bz2 |
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/scsi/scsi.c')
-rw-r--r-- | drivers/scsi/scsi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 78d729d..99be5ae 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, }; |