summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-04-25 10:54:46 -0600
committerTom Rini <trini@konsulko.com>2023-04-27 13:51:06 -0400
commitf0af25a10822ece736b0711a2339731fd0d3140d (patch)
treecc9d9f25daa3d50af739c3f36df7aa062b6ecdcd /drivers/block
parent708404c9e9648069d59cb9f3df77e200054f68c7 (diff)
downloadu-boot-f0af25a10822ece736b0711a2339731fd0d3140d.tar.gz
u-boot-f0af25a10822ece736b0711a2339731fd0d3140d.tar.bz2
u-boot-f0af25a10822ece736b0711a2339731fd0d3140d.zip
ide: Combine the two loops in ide_probe()
The two loops in this function operate on the same ide_dev_desc[] array. Combine them to reduce duplication. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/ide.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index 5fbf144da9..d682d6ad9e 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -1021,7 +1021,12 @@ static int ide_probe(struct udevice *udev)
putc('\n');
- for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; ++i) {
+ schedule();
+
+ for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; i++) {
+ if (!bus_ok[IDE_BUS(i)])
+ continue;
+
ide_dev_desc[i].type = DEV_TYPE_UNKNOWN;
ide_dev_desc[i].uclass_id = UCLASS_IDE;
ide_dev_desc[i].devnum = i;
@@ -1030,14 +1035,9 @@ static int ide_probe(struct udevice *udev)
ide_dev_desc[i].log2blksz =
LOG2_INVALID(typeof(ide_dev_desc[i].log2blksz));
ide_dev_desc[i].lba = 0;
- if (!bus_ok[IDE_BUS(i)])
- continue;
ide_ident(&ide_dev_desc[i]);
dev_print(&ide_dev_desc[i]);
- }
- schedule();
- for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; i++) {
if (ide_dev_desc[i].type != DEV_TYPE_UNKNOWN) {
struct udevice *blk_dev;
struct blk_desc *desc;