From patchwork Wed May 21 11:21:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 30542 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 239FB20671 for ; Wed, 21 May 2014 11:24:22 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf7852945obc.1 for ; Wed, 21 May 2014 04:24:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=CcBvSscaDpNjMkSKdb+ZjgC2wM4zVZcEvFZd7V8A+Us=; b=XGYibRAY2YD2xhFfs77e2PnqUDb5Ne61ZVnuiabZPRBBtAoAeZozMb5O/DdiTillLL kmTvubtKKxeoeYGhBe6+Cmef5VW6CuX22yFvIT7xmS6CLeIrhja1NXzLpmK7IqpXdmTB EmEWi3pANclS/SQszFT3rhFtGbGBlmetnvS/UdtDJtdi80OReO64Pzi+utC+yTqy5yMs io9pUJABCTfAru+Tc05rH/Tqjnxu9edbsNKLsqaYb6cQSgoW9hIBlfitzyJxAYRUVb3h nA66O1IrXg+Z81Jjje5AIjhQaOAL+KCfupbsPWnaR1CP0Ld+MSqrvPjN1VdB5Ausc1RP Kkig== X-Gm-Message-State: ALoCoQn6OiXU07w2IT6VZQBCNalgk5T5JwsQr9TeEIzeLi+tldrQARFO8geS2+ldsdxtn3nLc7HZ X-Received: by 10.182.226.166 with SMTP id rt6mr8909594obc.47.1400671461611; Wed, 21 May 2014 04:24:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.16 with SMTP id r16ls686509qga.71.gmail; Wed, 21 May 2014 04:24:21 -0700 (PDT) X-Received: by 10.58.196.236 with SMTP id ip12mr78340vec.47.1400671461441; Wed, 21 May 2014 04:24:21 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id vu1si990669vdb.90.2014.05.21.04.24.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 04:24:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id oz11so2276369veb.2 for ; Wed, 21 May 2014 04:24:21 -0700 (PDT) X-Received: by 10.58.135.136 with SMTP id ps8mr15622530veb.18.1400671461368; Wed, 21 May 2014 04:24:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp104697vcb; Wed, 21 May 2014 04:24:20 -0700 (PDT) X-Received: by 10.224.16.199 with SMTP id p7mr67960217qaa.76.1400671460826; Wed, 21 May 2014 04:24:20 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id l66si958940qgf.78.2014.05.21.04.24.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 May 2014 04:24:20 -0700 (PDT) Received-SPF: none (google.com: linux-mtd-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wn4be-0000GQ-Vb; Wed, 21 May 2014 11:22:46 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wn4bH-0008I7-C6; Wed, 21 May 2014 11:22:24 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s4LBM0m9024132; Wed, 21 May 2014 06:22:01 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4LBM0mF027286; Wed, 21 May 2014 06:22:00 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Wed, 21 May 2014 06:22:00 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4LBLAAh018495; Wed, 21 May 2014 06:21:57 -0500 From: Roger Quadros To: , Subject: [RFC PATCH 12/16] mtd: nand: omap: Copy platform data parameters to omap_nand_info data Date: Wed, 21 May 2014 14:21:00 +0300 Message-ID: <1400671264-10702-13-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400671264-10702-1-git-send-email-rogerq@ti.com> References: <1400671264-10702-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140521_042223_539057_CB240786 X-CRM114-Status: GOOD ( 12.72 ) X-Spam-Score: -5.7 (-----) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-5.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.152 listed in list.dnswl.org] -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: devicetree@vger.kernel.org, robertcnelson@gmail.com, jg1.han@samsung.com, nsekhar@ti.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, pekon@ti.com, ezequiel.garcia@free-electrons.com, javier@dowhile0.org, linux-omap@vger.kernel.org, dwmw2@infradead.org, Roger Quadros X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Copy all the platform data parameters to the driver's local data structure 'omap_nand_info' and use it in the entire driver. This will make it easer for device tree migration. Signed-off-by: Roger Quadros --- drivers/mtd/nand/omap2.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index fee0458..7ff5cb3 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -184,15 +184,19 @@ static struct nand_ecclayout omap_oobinfo; struct omap_nand_info { struct nand_hw_control controller; - struct omap_nand_platform_data *pdata; struct mtd_info mtd; struct nand_chip nand; struct platform_device *pdev; int gpmc_cs; + bool dev_ready; + enum nand_io xfer_type; + int devsize; + enum omap_ecc ecc_opt; + struct device_node *elm_of_node; + unsigned long phys_base; void __iomem *gpmc_base; - enum omap_ecc ecc_opt; struct completion comp; struct dma_chan *dma; int gpmc_irq; @@ -1708,6 +1712,11 @@ static int omap_nand_probe(struct platform_device *pdev) info->gpmc_cs = pdata->cs; info->of_node = pdata->of_node; info->ecc_opt = pdata->ecc_opt; + info->dev_ready = pdata->dev_ready; + info->xfer_type = pdata->xfer_type; + info->devsize = pdata->devsize; + info->elm_of_node = pdata->elm_of_node; + mtd = &info->mtd; mtd->priv = &info->nand; mtd->name = dev_name(&pdev->dev); @@ -1762,7 +1771,7 @@ static int omap_nand_probe(struct platform_device *pdev) * chip delay which is slightly more than tR (AC Timing) of the NAND * device and read status register until you get a failure or success */ - if (pdata->dev_ready) { + if (info->dev_ready) { nand_chip->dev_ready = omap_dev_ready; nand_chip->chip_delay = 0; } else { @@ -1771,7 +1780,7 @@ static int omap_nand_probe(struct platform_device *pdev) } /* scan NAND device connected to chip controller */ - nand_chip->options |= pdata->devsize & NAND_BUSWIDTH_16; + nand_chip->options |= info->devsize & NAND_BUSWIDTH_16; if (nand_scan_ident(mtd, 1, NULL)) { pr_err("nand device scan failed, may be bus-width mismatch\n"); err = -ENXIO; @@ -1779,14 +1788,14 @@ static int omap_nand_probe(struct platform_device *pdev) } /* check for small page devices */ - if ((mtd->oobsize < 64) && (pdata->ecc_opt != OMAP_ECC_HAM1_CODE_HW)) { + if ((mtd->oobsize < 64) && (info->ecc_opt != OMAP_ECC_HAM1_CODE_HW)) { pr_err("small page devices are not supported\n"); err = -EINVAL; goto return_error; } /* re-populate low-level callbacks based on xfer modes */ - switch (pdata->xfer_type) { + switch (info->xfer_type) { case NAND_OMAP_PREFETCH_POLLED: nand_chip->read_buf = omap_read_buf_pref; nand_chip->write_buf = omap_write_buf_pref; @@ -1849,7 +1858,7 @@ static int omap_nand_probe(struct platform_device *pdev) default: dev_err(&pdev->dev, - "xfer_type(%d) not supported!\n", pdata->xfer_type); + "xfer_type(%d) not supported!\n", info->xfer_type); err = -EINVAL; goto return_error; } @@ -1945,7 +1954,7 @@ static int omap_nand_probe(struct platform_device *pdev) ecclayout->oobfree->offset = ecclayout->eccpos[ecclayout->eccbytes - 1] + 1; /* This ECC scheme requires ELM H/W block */ - if (is_elm_present(info, pdata->elm_of_node, BCH4_ECC) < 0) { + if (is_elm_present(info, info->elm_of_node, BCH4_ECC) < 0) { pr_err("nand: error: could not initialize ELM\n"); err = -ENODEV; goto return_error; @@ -2011,7 +2020,7 @@ static int omap_nand_probe(struct platform_device *pdev) nand_chip->ecc.read_page = omap_read_page_bch; nand_chip->ecc.write_page = omap_write_page_bch; /* This ECC scheme requires ELM H/W block */ - err = is_elm_present(info, pdata->elm_of_node, BCH8_ECC); + err = is_elm_present(info, info->elm_of_node, BCH8_ECC); if (err < 0) { pr_err("nand: error: could not initialize ELM\n"); goto return_error;