Skip to contentSkip to conversation

nand: Fix nand info for no device

PATCH New Tony Lindgren 3 participants 3 messages Aug 29, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nand: Fix nand info for no device

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.

---
 cmd/nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
cmd/nand.c +3 -3
@@ -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;
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 nand: Fix nand info for no device

Quoted 8 lines · Tony Lindgren

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160829/7b9754de/attachment.sig>
#2 lore raw

PATCH 1/1 nand: Fix nand info for no device

In reply to Tony Lindgren
Quoted 11 lines · Tony Lindgren

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.

---
?cmd/nand.c | 6 +++---
?1 file changed, 3 insertions(+), 3 deletions(-)

I also see a few instances of this in drivers/dfu/dfu_nand.c and drivers/mtd/nand/omap_gpmc.c.

-Scott