From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from moutng.kundenserver.de ([212.227.126.183]) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1JOxge-00055c-K2 for linux-mtd@lists.infradead.org; Tue, 12 Feb 2008 16:08:55 +0000 From: Stefan Roese To: linux-mtd@lists.infradead.org Subject: [PATCH] mtd: Fix physmap_of to not exit upon unsuccessful partition scan Date: Tue, 12 Feb 2008 17:03:01 +0100 Message-Id: <1202832181-1783-1-git-send-email-sr@denx.de> Cc: scottwood@freescale.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , The patch 9a310d21196f38f6ad0ad146057548653e495c09 ("[MTD] Factor out OF partition support from the NOR driver.") introduced an problem. Now the physmap_of driver returns with error upon the first unsuccessful partition scan (parse_mtd_partitions()). This is not wanted, since even when the RedBoot/cmdlinepart partition scan is unsuccessful, the other scan's (of_mtd_parse_partitions(), parse_obsolete_partitions()) should be done nevertheless. This patch fixes this problem. Signed-off-by: Stefan Roese --- Scott, could you please take a look at this patch and add you ACK if you think it is ok? Thanks. drivers/mtd/maps/physmap_of.c | 16 ++++------------ 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 49acd41..9808c0d 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -224,24 +224,16 @@ static int __devinit of_flash_probe(struct of_device *dev, /* First look for RedBoot table or partitions on the command * line, these take precedence over device tree information */ err = parse_mtd_partitions(info->mtd, part_probe_types, - &info->parts, 0); - if (err < 0) - return err; + &info->parts, 0); #ifdef CONFIG_MTD_OF_PARTS - if (err == 0) { + if (err < 0) err = of_mtd_parse_partitions(&dev->dev, info->mtd, - dp, &info->parts); - if (err < 0) - return err; - } + dp, &info->parts); #endif - if (err == 0) { + if (err < 0) err = parse_obsolete_partitions(dev, info, dp); - if (err < 0) - return err; - } if (err > 0) add_mtd_partitions(info->mtd, info->parts, err); -- 1.5.4.1