From patchwork Tue Jun 27 00:13:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 780923 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 3wxRQB5wlVz9s72 for ; Tue, 27 Jun 2017 10:20:02 +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="jt7aa8yZ"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id 90EA2C21D8D; Tue, 27 Jun 2017 00:17:10 +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 9DA8CC21D98; Tue, 27 Jun 2017 00:14:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CA522C21D54; Tue, 27 Jun 2017 00:13:37 +0000 (UTC) Received: from lelnx193.ext.ti.com (lelnx193.ext.ti.com [198.47.27.77]) by lists.denx.de (Postfix) with ESMTPS id CF2A2C21C46 for ; Tue, 27 Jun 2017 00:13:32 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v5R0DCA7024572; Mon, 26 Jun 2017 19:13:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1498522392; bh=afOVI2YU4bFcWRRu6RfjqHVuD48wVh/8HYgkool0R+c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jt7aa8yZ4mcVV9jwbAbzaiXxyy9rslfufnqnPlqHlAjOxbZCzfieF1YrY0K7KDO5E Besi47PzAMF5d8VCp5ymqBuHYUTWAkHM9PWTK0IDzoNWx11dX4rALQ/7PyMlgPLFWE rccyxURRSEusTrn7X6SasnUxR1sNvtIQVVhvqzyY= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v5R0DCTF024965; Mon, 26 Jun 2017 19:13:12 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Mon, 26 Jun 2017 19:13:11 -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 v5R0DC2P010865; Mon, 26 Jun 2017 19:13:12 -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 v5R0DB328802; Mon, 26 Jun 2017 19:13:11 -0500 (CDT) From: Grygorii Strashko To: Lokesh Vutla , Tom Rini , Scott Wood , Simon Glass Date: Mon, 26 Jun 2017 19:13:01 -0500 Message-ID: <20170627001308.23513-12-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 11/18] mtd: nand: drv: 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 --- drivers/mtd/nand/fsmc_nand.c | 2 +- drivers/mtd/nand/zynq_nand.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c index a1f2cba..d5d1056 100644 --- a/drivers/mtd/nand/fsmc_nand.c +++ b/drivers/mtd/nand/fsmc_nand.c @@ -409,7 +409,7 @@ int fsmc_nand_switch_ecc(uint32_t eccstrength) * Nomadik SoC is currently supporting this fsmc_nand_switch_ecc() * function, as it doesn't need to switch to a different ECC layout. */ - mtd = nand_info[nand_curr_device]; + mtd = get_nand_dev_by_index(nand_curr_device); nand = mtd_to_nand(mtd); /* Setup the ecc configurations again */ diff --git a/drivers/mtd/nand/zynq_nand.c b/drivers/mtd/nand/zynq_nand.c index cb3340d..948f059 100644 --- a/drivers/mtd/nand/zynq_nand.c +++ b/drivers/mtd/nand/zynq_nand.c @@ -1008,7 +1008,7 @@ static int zynq_nand_init(struct nand_chip *nand_chip, int devnum) } xnand->nand_base = (void __iomem *)ZYNQ_NAND_BASEADDR; - mtd = (struct mtd_info *)&nand_info[0]; + mtd = get_nand_dev_by_index(0); nand_chip->priv = xnand; mtd->priv = nand_chip;