Commit edba8cc4f363112597466909e99b20a3b4469447

Authored by Grygorii Strashko
Committed by Tom Rini
1 parent bfdba68eac

common: use get_nand_dev_by_index()

As part of preparation for nand DM conversion the new API has been
introduced to remove direct access to nand_info array. So, use it here
instead of accessing to nand_info array directly.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

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

... ... @@ -59,7 +59,7 @@
59 59 return -EINVAL;
60 60 }
61 61  
62   - *mtd = nand_info[dev->id->num];
  62 + *mtd = get_nand_dev_by_index(dev->id->num);
63 63  
64 64 return 0;
65 65 }
common/splash_source.c
... ... @@ -47,9 +47,10 @@
47 47 #ifdef CONFIG_CMD_NAND
48 48 static int splash_nand_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
49 49 {
50   - return nand_read_skip_bad(nand_info[nand_curr_device], offset,
  50 + struct mtd_info *mtd = get_nand_dev_by_index(nand_curr_device);
  51 + return nand_read_skip_bad(mtd, offset,
51 52 &read_size, NULL,
52   - nand_info[nand_curr_device]->size,
  53 + mtd->size,
53 54 (u_char *)bmp_load_addr);
54 55 }
55 56 #else