From: Stefan Roese <sr@denx.de>
To: linux-mtd@lists.infradead.org
Cc: dwmw2@infradead.org
Subject: [PATCH v2] mtd: Fix physmap_of to not exit upon unsuccessful partition scan
Date: Wed, 13 Feb 2008 12:19:52 +0100 [thread overview]
Message-ID: <1202901592-19718-1-git-send-email-sr@denx.de> (raw)
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 <sr@denx.de>
---
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..09a78ea 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
next reply other threads:[~2008-02-13 11:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-13 11:19 Stefan Roese [this message]
2008-02-14 14:14 ` [PATCH v2] mtd: Fix physmap_of to not exit upon unsuccessful partition scan Peter Korsgaard
2008-02-14 15:44 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1202901592-19718-1-git-send-email-sr@denx.de \
--to=sr@denx.de \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox