From: Peter Korsgaard <jacmet@sunsite.dk>
To: Stefan Roese <sr@denx.de>
Cc: Scott Wood <scottwood@freescale.com>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: Fix physmap_of to not exit upon unsuccessful partition scan
Date: Thu, 14 Feb 2008 13:49:04 +0100 [thread overview]
Message-ID: <87wsp7r9dr.fsf@macbook.be.48ers.dk> (raw)
In-Reply-To: <200802122037.27864.sr@denx.de> (Stefan Roese's message of "Tue\, 12 Feb 2008 20\:37\:27 +0100")
>>>>> "Stefan" == Stefan Roese <sr@denx.de> writes:
Stefan> On Tuesday 12 February 2008, Scott Wood wrote:
>> >> Under what conditions are you actually seeing this fail?
>> >
>> > When CONFIG_MTD_REDBOOT_PARTS is not defined for example it returns with
>> > -22 (EINVAL).
>>
>> Ah, I see -- it seems the cmdline partition code behaves differently
>> than the redboot code.
>>
>> Your patch changes it to treat zero as success, however -- which breaks
>> some other cases. The test should be "err <= 0", which is what
>> parse_mtd_partiitions() itself uses in its loop.
Stefan> OK, I'll fixup another version of this patch tomorrow.
I would prefer to fix up cmdlinepart.c instead, as missing cmdline
data isn't really an error.
>From 7cc1d55f9704a9df1053aefd21fd5db98ac4c983 Mon Sep 17 00:00:00 2001
From: Peter Korsgaard <jacmet@sunsite.dk>
Date: Thu, 14 Feb 2008 13:46:13 +0100
Subject: [PATCH] cmdlinepart: Missing partition info is not an error
Return 0 partitions instead of -EINVAL on no mtdpart= argument on kernel
cmdline or missing partition info for device.
---
drivers/mtd/cmdlinepart.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index b44292a..08b82c9 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -308,9 +308,6 @@ static int parse_cmdline_partitions(struct mtd_info *master,
struct cmdline_mtd_partition *part;
char *mtd_id = master->name;
- if(!cmdline)
- return -EINVAL;
-
/* parse command line */
if (!cmdline_parsed)
mtdpart_setup_real(cmdline);
@@ -341,7 +338,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
return part->num_parts;
}
}
- return -EINVAL;
+ return 0;
}
--
debian.1.5.3.7.1-dirty
--
Bye, Peter Korsgaard
prev parent reply other threads:[~2008-02-14 12:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-12 16:03 [PATCH] mtd: Fix physmap_of to not exit upon unsuccessful partition scan Stefan Roese
2008-02-12 18:06 ` Scott Wood
2008-02-12 19:15 ` Stefan Roese
2008-02-12 19:27 ` Scott Wood
2008-02-12 19:37 ` Stefan Roese
2008-02-14 12:49 ` Peter Korsgaard [this message]
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=87wsp7r9dr.fsf@macbook.be.48ers.dk \
--to=jacmet@sunsite.dk \
--cc=linux-mtd@lists.infradead.org \
--cc=scottwood@freescale.com \
--cc=sr@denx.de \
/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