From patchwork Tue Mar 25 08:19:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 26990 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B22720062 for ; Tue, 25 Mar 2014 08:26:30 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oz11sf296595veb.9 for ; Tue, 25 Mar 2014 01:26:30 -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:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=3QN/2fQ51jcia1l3tB17LLkIR70lxfq1Mdm0YdELP3Q=; b=SXvSQiMzZTUjCzZV5DaR7MwwKINOLBUnBJw7LqInwQuGrUPwlCqsCIRI360T5xHn1O Gnc23FnQfZsgCLLbtkQMR2guBaNR5MBg4z/KrGUi/+jeuoVsOxW7t8sO6UbnWYyoA63B xU7t/sY5SYOom5qb8FaskcJHosqrlLv2EsPsy6f1YZthuufzxDdiPs1iFO06a2oo93mX k9ZnbMGhyZPsY8XxmfGP39nbjvbTG+eGkaZs2g0e41EZ5fwbYZgr00K7ROIQh2xpshhz Gtrq3f9wE+lAxetLAbDsqns+D9C841NXrT6bq/bP4o3N38ONLaDUXGhILvS6n+xkKO31 0O+A== X-Gm-Message-State: ALoCoQm3dUJQ/YxL7tjFh5/J/LPDcvqQMkMu39dJBmL0ovf/8RQGlIYKNArcKgGNBGXPV6tZIGrI X-Received: by 10.236.83.112 with SMTP id p76mr23154762yhe.51.1395735990175; Tue, 25 Mar 2014 01:26:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.100.137 with SMTP id s9ls139183qge.57.gmail; Tue, 25 Mar 2014 01:26:30 -0700 (PDT) X-Received: by 10.58.1.97 with SMTP id 1mr5551356vel.23.1395735990074; Tue, 25 Mar 2014 01:26:30 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id kj3si3674635vdb.123.2014.03.25.01.26.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Mar 2014 01:26:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id lg15so137593vcb.30 for ; Tue, 25 Mar 2014 01:26:30 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr4649400vdx.28.1395735990003; Tue, 25 Mar 2014 01:26:30 -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.78.9 with SMTP id i9csp285555vck; Tue, 25 Mar 2014 01:26:29 -0700 (PDT) X-Received: by 10.180.78.200 with SMTP id d8mr21295509wix.34.1395735988507; Tue, 25 Mar 2014 01:26:28 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [85.118.1.10]) by mx.google.com with ESMTPS id je10si12206618wic.13.2014.03.25.01.26.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Mar 2014 01:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 85.118.1.10 as permitted sender) client-ip=85.118.1.10; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSMfL-0001Zt-MW; Tue, 25 Mar 2014 08:25:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSMeC-0002Xh-LL; Tue, 25 Mar 2014 08:23:48 +0000 Received: from mail-wg0-f45.google.com ([74.125.82.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WSMcG-0002Ew-8f for linux-mtd@lists.infradead.org; Tue, 25 Mar 2014 08:21:52 +0000 Received: by mail-wg0-f45.google.com with SMTP id l18so80376wgh.16 for ; Tue, 25 Mar 2014 01:21:26 -0700 (PDT) X-Received: by 10.181.13.11 with SMTP id eu11mr21213790wid.30.1395735686505; Tue, 25 Mar 2014 01:21:26 -0700 (PDT) Received: from lee--X1.home (host109-148-113-193.range109-148.btcentralplus.com. [109.148.113.193]) by mx.google.com with ESMTPSA id k4sm5567676wib.19.2014.03.25.01.21.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Mar 2014 01:21:25 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [RFC 36/47] mtd: nand: stm_nand_bch: parse partitions and register an MTD device Date: Tue, 25 Mar 2014 08:19:53 +0000 Message-Id: <1395735604-26706-37-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395735604-26706-1-git-send-email-lee.jones@linaro.org> References: <1395735604-26706-1-git-send-email-lee.jones@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140325_042148_485394_6438B13C X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.45 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: angus.clark@st.com, kernel@stlinux.com, lee.jones@linaro.org, linux-mtd@lists.infradead.org, pekon@ti.com, computersforpeace@gmail.com, dwmw2@infradead.org 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: , MIME-Version: 1.0 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: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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 Issue the core parse partitions and register as MTD device call. Signed-off-by: Lee Jones --- drivers/mtd/nand/stm_nand_bch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/stm_nand_bch.c b/drivers/mtd/nand/stm_nand_bch.c index abbb4d9..a0f0ae2 100644 --- a/drivers/mtd/nand/stm_nand_bch.c +++ b/drivers/mtd/nand/stm_nand_bch.c @@ -1738,6 +1738,7 @@ static void *stm_bch_dt_get_pdata(struct platform_device *pdev) static int stm_nand_bch_probe(struct platform_device *pdev) { + const char *part_probes[] = { "cmdlinepart", "ofpart", NULL, }; struct stm_plat_nand_bch_data *pdata = pdev->dev.platform_data; struct device_node *np = pdev->dev.of_node; struct mtd_part_parser_data ppdata; @@ -1873,7 +1874,9 @@ static int stm_nand_bch_probe(struct platform_device *pdev) nandi_dump_bad_blocks(nandi); - return 0; + /* Add partitions */ + return mtd_device_parse_register(mtd, part_probes, &ppdata, + bank->partitions, bank->nr_partitions); } static int stm_nand_bch_remove(struct platform_device *pdev)