From patchwork Thu Jun 9 14:22:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 99756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D5BCCB6FE2 for ; Fri, 10 Jun 2011 00:24:21 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QUg9b-0000xi-EH; Thu, 09 Jun 2011 14:24:11 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QUg9a-0007hu-LN; Thu, 09 Jun 2011 14:24:10 +0000 Received: from mail-ww0-f41.google.com ([74.125.82.41]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QUg8j-0007WI-Ag for linux-mtd@lists.infradead.org; Thu, 09 Jun 2011 14:23:18 +0000 Received: by wwi18 with SMTP id 18so4379386wwi.0 for ; Thu, 09 Jun 2011 07:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=XvweRdOFebMV7ZTwml9AJW5Q90gT1qlNLiewxf4HrwI=; b=obDW+z1ncznesVy8My3Rsa551WR7TWOIuAww4VT9LReEflYEOLcYKsXHB9Us8PPTWD Et81VdIqWziYxvDVF+Ed3gGMveMIdZKlILGupYa3zkUZCXU1RKAD8drle7Ca672KKxiP 06mI2h3XHQbjQqmBRG2PyKPbYDf40su3XKGIw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=u8U0E/ozJzxLb2guxW+eFl0chAyWrQy2b/+PbzhkvTwTI7KJbqwDrKYezt8Vt0K+w1 d63+NUEC7Q//LAODgVoOnOsXWVDdWy8xtycOd9DjVsZ3eUcaX2HgDZu0HIHnou911dSM L8NlYrHFJADzivcNS/DF/D57peHFuxxTgZICA= Received: by 10.216.188.20 with SMTP id z20mr900451wem.66.1307629395054; Thu, 09 Jun 2011 07:23:15 -0700 (PDT) Received: from doriath.ww600.siemens.net ([91.213.169.4]) by mx.google.com with ESMTPS id b70sm872886wek.44.2011.06.09.07.23.13 (version=SSLv3 cipher=OTHER); Thu, 09 Jun 2011 07:23:14 -0700 (PDT) From: Dmitry Eremin-Solenikov To: linux-mtd@lists.infradead.org Subject: [PATCH 04/17] mtd: fsl_elbc_nand: use ofpart through generic parsing Date: Thu, 9 Jun 2011 18:22:53 +0400 Message-Id: <1307629388-24769-5-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1307629388-24769-1-git-send-email-dbaryshkov@gmail.com> References: <1307629388-24769-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110609_102317_595319_D0DCC4DE X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.41 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (dbaryshkov[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain 0.0 T_TO_NO_BRKTS_FREEMAIL T_TO_NO_BRKTS_FREEMAIL Cc: David Woodhouse , dedekind1@gmail.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov --- drivers/mtd/nand/fsl_elbc_nand.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index f3384fa..5236840 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -842,7 +842,7 @@ static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev) struct resource res; struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl; static const char *part_probe_types[] - = { "cmdlinepart", "RedBoot", NULL }; + = { "cmdlinepart", "RedBoot", "ofpart", NULL }; struct mtd_partition *parts; int ret; int bank; @@ -910,6 +910,7 @@ static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev) goto err; } + priv->mtd.node = pdev->dev.of_node; priv->mtd.name = kasprintf(GFP_KERNEL, "%x.flash", (unsigned)res.start); if (!priv->mtd.name) { ret = -ENOMEM; @@ -938,12 +939,6 @@ static int __devinit fsl_elbc_nand_probe(struct platform_device *pdev) if (ret < 0) goto err; - if (ret == 0) { - ret = of_mtd_parse_partitions(priv->dev, node, &parts); - if (ret < 0) - goto err; - } - mtd_device_register(&priv->mtd, parts, ret); printk(KERN_INFO "eLBC NAND device at 0x%llx, bank %d\n",