From patchwork Wed Jun 11 08:56:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 31740 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 61E30203C2 for ; Wed, 11 Jun 2014 09:01:04 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id a13sf1789099igq.0 for ; Wed, 11 Jun 2014 02:01:03 -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=wWlgDhxVLlX8ka+5m/acLBXKdbV1PNHDZDtYeo5nVvQ=; b=fXMTA3UHblwek3xSuhLOPBr6/BFg9esucOF9hai6G1wGpjtB2UV+Z8aSHDsIDt2PMy ag4M/ZR5WgTAtqVwKGoQewKcVBHhcK1t1d6JYRl6ZSLKFkp3mF9D9Z5Vx2BY5c8FcRl+ C4871u6XOM2OSKndNY+2b1KZFMvKQxEqUbT8gj4PS+D2qVkQGs6UJngvmVzaws5iBSS/ hPfPw7fYFxha3xspc07m0i7+boPdB+u6c3k/GacjPasIuGkCgkK7xaiUlW7cTcKGvTOA tzjUyBR9Lp5znePHOB7dyA1vxsM9h2MRNTe1pwnIfjn8Riq5h/UUVvUDk8DYveOkYzfm Qb+w== X-Gm-Message-State: ALoCoQly8WtvvmNgESKf3tqaAfWnz2oG5cPE8ErzdvrQHr3nC3lpodgG/5HSHnaGRxp98CkJWmgS X-Received: by 10.182.43.196 with SMTP id y4mr749341obl.35.1402477263803; Wed, 11 Jun 2014 02:01:03 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.165 with SMTP id t34ls156595qgd.93.gmail; Wed, 11 Jun 2014 02:01:03 -0700 (PDT) X-Received: by 10.221.40.193 with SMTP id tr1mr1761422vcb.31.1402477263681; Wed, 11 Jun 2014 02:01:03 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id cn9si12759375vcb.71.2014.06.11.02.01.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 02:01:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id db12so7267378veb.7 for ; Wed, 11 Jun 2014 02:01:03 -0700 (PDT) X-Received: by 10.220.12.66 with SMTP id w2mr36844558vcw.15.1402477263602; Wed, 11 Jun 2014 02:01:03 -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 vs6csp286627vcb; Wed, 11 Jun 2014 02:01:03 -0700 (PDT) X-Received: by 10.140.82.180 with SMTP id h49mr47398003qgd.84.1402477263132; Wed, 11 Jun 2014 02:01:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id s49si29756249qgs.97.2014.06.11.02.01.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2014 02:01:03 -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 1WueMm-0002oS-Bq; Wed, 11 Jun 2014 08:58:44 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WueM9-0001y6-Jc; Wed, 11 Jun 2014 08:58:06 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5B8vjNP027492; Wed, 11 Jun 2014 03:57:45 -0500 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 s5B8vjBC008719; Wed, 11 Jun 2014 03:57:45 -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:45 -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 s5B8uiSo020510; Wed, 11 Jun 2014 03:57:42 -0500 From: Roger Quadros To: , , Subject: [PATCH 16/36] mtd: onenand: omap: Remove regulator management code Date: Wed, 11 Jun 2014 11:56:21 +0300 Message-ID: <1402477001-31132-17-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_015805_745008_7D90193D X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. 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) [198.47.26.153 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 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.176 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 None of the OMAP platforms are suppying the "regulator_can_sleep" parameter via platform data. Regulator management is generic enough to be done in onenand_base driver if required. Mark the "regulator_can_sleep" platform data parameter as deprecated. Signed-off-by: Roger Quadros --- drivers/mtd/onenand/omap2.c | 42 +------------------------ include/linux/platform_data/mtd-onenand-omap2.h | 3 +- 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index d945473..a5f5ad8 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -59,7 +58,6 @@ struct omap2_onenand { int dma_channel; int freq; int (*setup)(void __iomem *base, int *freq_ptr); - struct regulator *regulator; u8 flags; }; @@ -583,30 +581,6 @@ static void omap2_onenand_shutdown(struct platform_device *pdev) memset((__force void *)c->onenand.base, 0, ONENAND_BUFRAM_SIZE); } -static int omap2_onenand_enable(struct mtd_info *mtd) -{ - int ret; - struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd); - - ret = regulator_enable(c->regulator); - if (ret != 0) - dev_err(&c->pdev->dev, "can't enable regulator\n"); - - return ret; -} - -static int omap2_onenand_disable(struct mtd_info *mtd) -{ - int ret; - struct omap2_onenand *c = container_of(mtd, struct omap2_onenand, mtd); - - ret = regulator_disable(c->regulator); - if (ret != 0) - dev_err(&c->pdev->dev, "can't disable regulator\n"); - - return ret; -} - static int omap2_onenand_probe(struct platform_device *pdev) { struct omap_onenand_platform_data *pdata; @@ -728,22 +702,11 @@ static int omap2_onenand_probe(struct platform_device *pdev) } } - if (pdata->regulator_can_sleep) { - c->regulator = regulator_get(&pdev->dev, "vonenand"); - if (IS_ERR(c->regulator)) { - dev_err(&pdev->dev, "Failed to get regulator\n"); - r = PTR_ERR(c->regulator); - goto err_release_dma; - } - c->onenand.enable = omap2_onenand_enable; - c->onenand.disable = omap2_onenand_disable; - } - if (pdata->skip_initial_unlocking) this->options |= ONENAND_SKIP_INITIAL_UNLOCKING; if ((r = onenand_scan(&c->mtd, 1)) < 0) - goto err_release_regulator; + goto err_release_dma; ppdata.of_node = pdata->of_node; r = mtd_device_parse_register(&c->mtd, NULL, &ppdata, @@ -758,8 +721,6 @@ static int omap2_onenand_probe(struct platform_device *pdev) err_release_onenand: onenand_release(&c->mtd); -err_release_regulator: - regulator_put(c->regulator); err_release_dma: if (c->dma_channel != -1) omap_free_dma(c->dma_channel); @@ -783,7 +744,6 @@ static int omap2_onenand_remove(struct platform_device *pdev) struct omap2_onenand *c = dev_get_drvdata(&pdev->dev); onenand_release(&c->mtd); - regulator_put(c->regulator); if (c->dma_channel != -1) omap_free_dma(c->dma_channel); omap2_onenand_shutdown(pdev); diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h index 56ff0e6..445b41e 100644 --- a/include/linux/platform_data/mtd-onenand-omap2.h +++ b/include/linux/platform_data/mtd-onenand-omap2.h @@ -25,10 +25,11 @@ struct omap_onenand_platform_data { int (*onenand_setup)(void __iomem *, int *freq_ptr); int dma_channel; u8 flags; - u8 regulator_can_sleep; u8 skip_initial_unlocking; /* for passing the partitions */ struct device_node *of_node; + + u8 regulator_can_sleep; /* deprecated */ }; #endif