From patchwork Fri Jun 18 10:08:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Tereshonkov X-Patchwork-Id: 56160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.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 26B3BB7D8B for ; Fri, 18 Jun 2010 20:10:18 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OPYVO-0000z7-GY; Fri, 18 Jun 2010 10:08:58 +0000 Received: from smtp.nokia.com ([192.100.105.134] helo=mgw-mx09.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1OPYVC-0000Oq-Vu for linux-mtd@lists.infradead.org; Fri, 18 Jun 2010 10:08:49 +0000 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o5IA8J9k024914 for ; Fri, 18 Jun 2010 05:08:44 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 18 Jun 2010 13:08:32 +0300 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 18 Jun 2010 13:08:32 +0300 Received: from localhost.localdomain (ramses.research.nokia.com [172.21.51.130]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o5IA8VmP021141; Fri, 18 Jun 2010 13:08:32 +0300 From: Roman Tereshonkov To: linux-mtd@lists.infradead.org Subject: [PATCH 4/4] mtd: create the mtd master device for given set of partitions Date: Fri, 18 Jun 2010 13:08:31 +0300 Message-Id: <1276855711-18570-5-git-send-email-roman.tereshonkov@nokia.com> X-Mailer: git-send-email 1.6.2.4 In-Reply-To: <1276855711-18570-4-git-send-email-roman.tereshonkov@nokia.com> References: <1276855711-18570-1-git-send-email-roman.tereshonkov@nokia.com> <1276855711-18570-2-git-send-email-roman.tereshonkov@nokia.com> <1276855711-18570-3-git-send-email-roman.tereshonkov@nokia.com> <1276855711-18570-4-git-send-email-roman.tereshonkov@nokia.com> X-OriginalArrivalTime: 18 Jun 2010 10:08:32.0853 (UTC) FILETIME=[352F3850:01CB0ECE] X-Nokia-AV: Clean X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100618_060848_166637_668B6563 X-CRM114-Status: GOOD ( 17.40 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [192.100.105.134 listed in list.dnswl.org] Cc: Roman Tereshonkov 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 The master device is needed for repartioning to be done. Signed-off-by: Roman Tereshonkov --- drivers/mtd/onenand/omap2.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index 9f322f1..f9bdad8 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c @@ -724,12 +724,14 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev) } #ifdef CONFIG_MTD_PARTITIONS - if (pdata->parts != NULL) + if (pdata->parts != NULL) { r = add_mtd_partitions(&c->mtd, pdata->parts, pdata->nr_parts); - else + if (r < 0) + goto err_release_onenand; + } #endif - r = add_mtd_device(&c->mtd); + r = add_mtd_device(&c->mtd); if (r < 0) goto err_release_onenand;