diff mbox

[U-Boot,v4,06/18] common: use get_nand_dev_by_index()

Message ID 20170627001308.23513-7-grygorii.strashko@ti.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Grygorii Strashko June 27, 2017, 12:12 a.m. UTC
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>
---
 common/fb_nand.c       | 2 +-
 common/splash_source.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Tom Rini July 12, 2017, 12:14 p.m. UTC | #1
On Mon, Jun 26, 2017 at 07:12:56PM -0500, Grygorii Strashko wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/fb_nand.c b/common/fb_nand.c
index c8c79e9..3d027d4 100644
--- a/common/fb_nand.c
+++ b/common/fb_nand.c
@@ -59,7 +59,7 @@  static int fb_nand_lookup(const char *partname,
 		return -EINVAL;
 	}
 
-	*mtd = nand_info[dev->id->num];
+	*mtd = get_nand_dev_by_index(dev->id->num);
 
 	return 0;
 }
diff --git a/common/splash_source.c b/common/splash_source.c
index d1647c8..476fd2f 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -47,9 +47,10 @@  static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
 #ifdef CONFIG_CMD_NAND
 static int splash_nand_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
 {
-	return nand_read_skip_bad(nand_info[nand_curr_device], offset,
+	struct mtd_info *mtd = get_nand_dev_by_index(nand_curr_device);
+	return nand_read_skip_bad(mtd, offset,
 				  &read_size, NULL,
-				  nand_info[nand_curr_device]->size,
+				  mtd->size,
 				  (u_char *)bmp_load_addr);
 }
 #else