public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] nand: Fix nand info for no device
@ 2016-08-29 16:11 Tony Lindgren
  2016-08-29 19:43 ` Tom Rini
  2016-08-29 22:59 ` Scott Wood
  0 siblings, 2 replies; 3+ messages in thread
From: Tony Lindgren @ 2016-08-29 16:11 UTC (permalink / raw)
  To: u-boot

Looks like we have few more places where we're testing for
nand_info[i]->name. We can now use just test for nand_info[i]
instead.

This fixes a data abort on devices with no NAND when doing
nand info.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 cmd/nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmd/nand.c b/cmd/nand.c
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -398,7 +398,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 		putc('\n');
 		for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++) {
-			if (nand_info[i]->name)
+			if (nand_info[i])
 				nand_print_and_set_info(i);
 		}
 		return 0;
@@ -433,7 +433,7 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	 * for another device is to be used.
 	 */
 	if (dev < 0 || dev >= CONFIG_SYS_MAX_NAND_DEVICE ||
-	    !nand_info[dev]->name) {
+	    !nand_info[dev]) {
 		puts("\nno devices available\n");
 		return 1;
 	}
@@ -991,7 +991,7 @@ usage:
 
 	idx = simple_strtoul(boot_device, NULL, 16);
 
-	if (idx < 0 || idx >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx]->name) {
+	if (idx < 0 || idx >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx]) {
 		printf("\n** Device %d not available\n", idx);
 		bootstage_error(BOOTSTAGE_ID_NAND_AVAILABLE);
 		return 1;
-- 
2.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-29 22:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-29 16:11 [U-Boot] [PATCH] nand: Fix nand info for no device Tony Lindgren
2016-08-29 19:43 ` Tom Rini
2016-08-29 22:59 ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox