From patchwork Wed Oct 29 02:12:02 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyungmin Park X-Patchwork-Id: 6203 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2F6E5DDE01 for ; Wed, 29 Oct 2008 13:15:46 +1100 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1Kv0Yh-0004X6-Fe; Wed, 29 Oct 2008 02:13:19 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1Kv0Yc-00041N-5K for linux-mtd@lists.infradead.org; Wed, 29 Oct 2008 02:13:18 +0000 Received: from epmmp2 (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0K9H007S7A47VC@mailout1.samsung.com> for linux-mtd@lists.infradead.org; Wed, 29 Oct 2008 11:12:07 +0900 (KST) Received: from spapp01.rdscm.com ([165.213.149.150]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0K9H0018WA472H@mmp2.samsung.com> for linux-mtd@lists.infradead.org; Wed, 29 Oct 2008 11:12:07 +0900 (KST) Received: from july ([165.213.135.100]) by spapp01.rdscm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 Oct 2008 11:12:05 +0900 Received: by july (sSMTP sendmail emulation); Wed, 29 Oct 2008 11:12:02 +0900 Date: Wed, 29 Oct 2008 11:12:02 +0900 From: Kyungmin Park Subject: [PATCH] [ONENAND] Add command line partition support on OMAP driver To: linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org Message-id: <20081029021202.GA32306@july> MIME-version: 1.0 Content-disposition: inline User-Agent: Mutt/1.5.14 (2007-02-12) X-OriginalArrivalTime: 29 Oct 2008 02:12:06.0189 (UTC) FILETIME=[BD97B5D0:01C9396B] X-Spam-Score: -3.6 (---) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (-3.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.4 SUBJECT_FUZZY_TION Attempt to obfuscate words in Subject: -4.0 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [203.254.224.24 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add command line partition support on OMAP driver Signed-off-by: Kyungmin Park diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index a9885d1..60cf668 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -51,6 +51,10 @@ #define ONENAND_IO_SIZE SZ_128K #define ONENAND_BUFRAM_SIZE (1024 * 5) +#ifdef CONFIG_MTD_PARTITIONS +static const char *part_probes[] = { "cmdlinepart", NULL, }; +#endif + struct omap2_onenand { struct platform_device *pdev; int gpmc_cs; @@ -685,9 +689,12 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) } #ifdef CONFIG_MTD_PARTITIONS - if (pdata->parts != NULL) + r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0); + if (r > 0) + r = add_mtd_partitions(&c->mtd, c->parts, r); + else if (pdata->parts != NULL) r = add_mtd_partitions(&c->mtd, pdata->parts, - pdata->nr_parts); + pdata->nr_parts); else #endif r = add_mtd_device(&c->mtd);