mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 23:47:24 +00:00
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>
This commit is contained in:
parent
708404c9e9
commit
f0af25a108
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue