Commit 8b7d51249eca113c4965a7c417f33d7eb569434b

Authored by Scott Wood
1 parent 4004a81828

nand: Fix some more NULL name tests

Now that nand_info[] is an array of pointers we need to test the
pointer itself rather than using name as a proxy for NULLness.

Fixes: b616d9b0a708eb9 ("nand: Embed mtd_info in struct nand_chip")
Signed-off-by: Scott Wood <oss@buserror.net>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Tony Lindgren <tony@atomide.com>
Acked-by: Tony Lindgren <tony@atomide.com>

Showing 3 changed files with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -191,7 +191,7 @@
191 191 struct mtd_info *mtd = nand_info[0];
192 192 char *cmd = argv[1];
193 193  
194   - if (CONFIG_SYS_MAX_NAND_DEVICE == 0 || !mtd->name) {
  194 + if (CONFIG_SYS_MAX_NAND_DEVICE == 0 || !mtd) {
195 195 puts("no devices available\n");
196 196 return 1;
197 197 }
drivers/dfu/dfu_nand.c
... ... @@ -39,7 +39,7 @@
39 39  
40 40 if (nand_curr_device < 0 ||
41 41 nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE ||
42   - !nand_info[nand_curr_device]->name) {
  42 + !nand_info[nand_curr_device]) {
43 43 printf("%s: invalid nand device\n", __func__);
44 44 return -1;
45 45 }
... ... @@ -148,7 +148,7 @@
148 148  
149 149 if (nand_curr_device < 0 ||
150 150 nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE ||
151   - !nand_info[nand_curr_device]->name) {
  151 + !nand_info[nand_curr_device]) {
152 152 printf("%s: invalid nand device\n", __func__);
153 153 return -1;
154 154 }
drivers/mtd/nand/omap_gpmc.c
... ... @@ -899,7 +899,7 @@
899 899  
900 900 if (nand_curr_device < 0 ||
901 901 nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE ||
902   - !nand_info[nand_curr_device]->name) {
  902 + !nand_info[nand_curr_device]) {
903 903 printf("nand: error: no NAND devices found\n");
904 904 return -ENODEV;
905 905 }