From patchwork Wed Jun 11 08:56:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 31731 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9754B203C2 for ; Wed, 11 Jun 2014 08:59:36 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id us18sf24294705veb.10 for ; Wed, 11 Jun 2014 01:59:36 -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=G8Cy3LR3gA2y7mGcvy6oeXcUaXDmqo9YyQV45Jg2E3c=; b=mghVXgDROL8KdkOoAD1kiMRAB7N4C7GeDUN5SKA1FXoJSDBdqTsOZs3x7EYWkYcXXl SJVuTxFKzdiXbfr3V7l6zXltUDOBNoUDImg2pIywCj8dz7lYOKmAXzd/43D7yRQJR0Pp Vr9IZ7VQ/mRj7iZmQTNDLlxVpAaUJN6KpHBmztrlhQMJKVYs2LscapkPcpigqlmfL13e ZRgOwOdQZljzAtX9KX56RuNIiZDJPPGK7UiiDpAp41DcCy3u9WgdntKSQeVgfBZUquXF enC5fxuR8xw8MqVU4kQmyrwuKMNNajj8arKqBvJ69IHrs76HPo/eA+Gf638udQImu9tM yaVg== X-Gm-Message-State: ALoCoQkSJoixhNWzVW+KDD9cYqDVMs6JsABqjhKDPAI1vKFNKZXmwexJqKnAXDEAdjNX82nDtAgN X-Received: by 10.58.34.47 with SMTP id w15mr3616065vei.20.1402477176419; Wed, 11 Jun 2014 01:59:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.225 with SMTP id o88ls2392033qge.88.gmail; Wed, 11 Jun 2014 01:59:36 -0700 (PDT) X-Received: by 10.221.7.71 with SMTP id on7mr37415075vcb.18.1402477176231; Wed, 11 Jun 2014 01:59:36 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id dj5si12769168vcb.21.2014.06.11.01.59.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 01:59:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so6173751veb.17 for ; Wed, 11 Jun 2014 01:59:36 -0700 (PDT) X-Received: by 10.52.101.168 with SMTP id fh8mr2236525vdb.34.1402477176133; Wed, 11 Jun 2014 01:59:36 -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.221.54.6 with SMTP id vs6csp286517vcb; Wed, 11 Jun 2014 01:59:35 -0700 (PDT) X-Received: by 10.224.134.201 with SMTP id k9mr32041484qat.59.1402477175624; Wed, 11 Jun 2014 01:59:35 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 39si29811634qga.14.2014.06.11.01.59.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2014 01:59:35 -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 1WueLr-0001wu-LB; Wed, 11 Jun 2014 08:57:47 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WueLg-0001hK-Le; Wed, 11 Jun 2014 08:57:37 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5B8vHD9004373; Wed, 11 Jun 2014 03:57:17 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5B8vHbq020777; Wed, 11 Jun 2014 03:57:17 -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.174.1; Wed, 11 Jun 2014 03:57:17 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5B8uiSg020510; Wed, 11 Jun 2014 03:57:13 -0500 From: Roger Quadros To: , , Subject: [PATCH 08/36] mtd: nand: omap: Copy platform data parameters to omap_nand_info data Date: Wed, 11 Jun 2014 11:56:13 +0300 Message-ID: <1402477001-31132-9-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1402477001-31132-1-git-send-email-rogerq@ti.com> References: <1402477001-31132-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-20140611_015736_803634_A5996825 X-CRM114-Status: GOOD ( 13.14 ) X-Spam-Score: -5.7 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.94.94.40 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: devicetree@vger.kernel.org, nsekhar@ti.com, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, linux-mtd@lists.infradead.org, pekon@ti.com, ezequiel.garcia@free-electrons.com, javier@dowhile0.org, linux-omap@vger.kernel.org, Roger Quadros X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 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.172 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 bb41796..e205863 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;