From patchwork Tue Jun 27 00:12:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 780919 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wxRLV60lmz9s8N for ; Tue, 27 Jun 2017 10:16:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="w7dij/sP"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id 79BA3C21C42; Tue, 27 Jun 2017 00:14:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 90F5AC21D6F; Tue, 27 Jun 2017 00:13:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8B17DC21C8F; Tue, 27 Jun 2017 00:13:30 +0000 (UTC) Received: from lelnx194.ext.ti.com (lelnx194.ext.ti.com [198.47.27.80]) by lists.denx.de (Postfix) with ESMTPS id CB76DC21C2A for ; Tue, 27 Jun 2017 00:13:27 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v5R0DB3l002404; Mon, 26 Jun 2017 19:13:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1498522391; bh=h3F42V6uA9xGg+6xt0PikD75JEvam1CAouEvnhTBe4A=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=w7dij/sPnHDyTRNi6bWGqWjodCyG2CTy90S2bTWCnpDX+sBceCOCebi8CF1I0Egnu IvIlObTaIOfzV1ypoJarXaJgCAcU7D+YAyP5eYrGCHdCYj/E4C2Rohli3t8UP0HrZd PKpLxlUEJ6jhA71zZ9MnaBRutxxksO3qIX/A2ANc= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v5R0DBeX024860; Mon, 26 Jun 2017 19:13:11 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Mon, 26 Jun 2017 19:13:10 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v5R0DAB2010850; Mon, 26 Jun 2017 19:13:10 -0500 Received: from localhost (uda0226610.dhcp.ti.com [128.247.59.147]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id v5R0DA328782; Mon, 26 Jun 2017 19:13:10 -0500 (CDT) From: Grygorii Strashko To: Lokesh Vutla , Tom Rini , Scott Wood , Simon Glass Date: Mon, 26 Jun 2017 19:12:56 -0500 Message-ID: <20170627001308.23513-7-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170627001308.23513-1-grygorii.strashko@ti.com> References: <20170627001308.23513-1-grygorii.strashko@ti.com> MIME-Version: 1.0 Cc: Stelian Pop , u-boot@lists.denx.de, Bo Shen , Franklin S Cooper Jr Subject: [U-Boot] [PATCH v4 06/18] common: use get_nand_dev_by_index() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- common/fb_nand.c | 2 +- common/splash_source.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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