From patchwork Wed Nov 12 23:39:48 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 8559 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 43426DDDF3 for ; Thu, 13 Nov 2008 22:50:37 +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 1L0agX-0000YI-Kg; Thu, 13 Nov 2008 11:48:29 +0000 Received: from smtp.gentoo.org ([140.211.166.183]) by bombadil.infradead.org with esmtps (Exim 4.68 #1 (Red Hat Linux)) id 1L0PJP-0000Hk-9Y for linux-mtd@lists.infradead.org; Wed, 12 Nov 2008 23:39:51 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id E297C64512; Wed, 12 Nov 2008 23:39:49 +0000 (UTC) From: Mike Frysinger To: linux-mtd@lists.infradead.org, David Woodhouse Subject: [PATCH] mtd/physmap: use parse_mtd() Date: Wed, 12 Nov 2008 18:39:48 -0500 Message-Id: <1226533189-8492-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.6.0.3 In-Reply-To: <1226533133-7405-1-git-send-email-vapier@gentoo.org> References: <1226533133-7405-1-git-send-email-vapier@gentoo.org> X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Thu, 13 Nov 2008 06:48:24 -0500 Cc: linux-kernel@vger.kernel.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: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Call parse_mtd() to handle partition/device registration rather than doing it all ourself. Signed-off-by: Mike Frysinger --- drivers/mtd/maps/physmap.c | 21 +-------------------- 1 files changed, 1 insertions(+), 20 deletions(-) diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 42d844f..9b87fd8 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -84,9 +84,6 @@ static int physmap_flash_remove(struct platform_device *dev) } static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL }; -#ifdef CONFIG_MTD_PARTITIONS -static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; -#endif static int physmap_flash_probe(struct platform_device *dev) { @@ -170,23 +167,7 @@ static int physmap_flash_probe(struct platform_device *dev) if (err) goto err_out; -#ifdef CONFIG_MTD_PARTITIONS - err = parse_mtd_partitions(info->cmtd, part_probe_types, &info->parts, 0); - if (err > 0) { - add_mtd_partitions(info->cmtd, info->parts, err); - return 0; - } - - if (physmap_data->nr_parts) { - printk(KERN_NOTICE "Using physmap partition information\n"); - add_mtd_partitions(info->cmtd, physmap_data->parts, - physmap_data->nr_parts); - return 0; - } -#endif - - add_mtd_device(info->cmtd); - return 0; + return parse_mtd(info->cmtd, NULL, physmap_data->parts, physmap_data->nr_parts); err_out: physmap_flash_remove(dev);