summaryrefslogtreecommitdiffstats
path: root/sys/boot/uboot/common
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2010-05-25 09:59:53 +0000
committerraj <raj@FreeBSD.org>2010-05-25 09:59:53 +0000
commit691628c1745dc83806f1cb5ce5d7c1834367c9cd (patch)
treebd689b0129e6f665135543e08014e9c5ec5f2ddc /sys/boot/uboot/common
parent8b66012ecb8cc5ea8d8f0090d80875243b574826 (diff)
downloadFreeBSD-src-691628c1745dc83806f1cb5ce5d7c1834367c9cd.zip
FreeBSD-src-691628c1745dc83806f1cb5ce5d7c1834367c9cd.tar.gz
Use loader devices only when they initialized properly.
Diffstat (limited to 'sys/boot/uboot/common')
-rw-r--r--sys/boot/uboot/common/main.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c
index 7d068ee..6c6a623 100644
--- a/sys/boot/uboot/common/main.c
+++ b/sys/boot/uboot/common/main.c
@@ -157,20 +157,22 @@ main(void)
panic("no U-Boot devices found");
printf("Number of U-Boot devices: %d\n", devs_no);
- /*
- * March through the device switch probing for things.
- */
- for (i = 0; devsw[i] != NULL; i++)
- if (devsw[i]->dv_init != NULL)
- (devsw[i]->dv_init)();
-
printf("\n");
printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
printf("(%s, %s)\n", bootprog_maker, bootprog_date);
meminfo();
+ /*
+ * March through the device switch probing for things.
+ */
for (i = 0; devsw[i] != NULL; i++) {
- printf("\nDevice %d: %s\n", i, devsw[i]->dv_name);
+
+ if (devsw[i]->dv_init == NULL)
+ continue;
+ if ((devsw[i]->dv_init)() != 0)
+ continue;
+
+ printf("\nDevice: %s\n", devsw[i]->dv_name);
currdev.d_dev = devsw[i];
currdev.d_type = currdev.d_dev->dv_type;
OpenPOWER on IntegriCloud