From owner-svn-src-head@FreeBSD.ORG Tue May 25 09:59:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A3AA1065676; Tue, 25 May 2010 09:59:54 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED6A98FC1B; Tue, 25 May 2010 09:59:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o4P9xrFr085270; Tue, 25 May 2010 09:59:53 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o4P9xrIs085267; Tue, 25 May 2010 09:59:53 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201005250959.o4P9xrIs085267@svn.freebsd.org> From: Rafal Jaworowski Date: Tue, 25 May 2010 09:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208534 - in head/sys/boot/uboot: common lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2010 09:59:54 -0000 Author: raj Date: Tue May 25 09:59:53 2010 New Revision: 208534 URL: http://svn.freebsd.org/changeset/base/208534 Log: Use loader devices only when they initialized properly. Modified: head/sys/boot/uboot/common/main.c head/sys/boot/uboot/lib/disk.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Tue May 25 05:45:16 2010 (r208533) +++ head/sys/boot/uboot/common/main.c Tue May 25 09:59:53 2010 (r208534) @@ -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; Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Tue May 25 05:45:16 2010 (r208533) +++ head/sys/boot/uboot/lib/disk.c Tue May 25 09:59:53 2010 (r208534) @@ -157,7 +157,7 @@ stor_init(void) } if (!found) { - printf("No storage devices\n"); + debugf("No storage devices\n"); return (-1); }