mtd: be silent when mtd partition parser cannot be found

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue May 24 21:59:06 EDT 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7c802fbd541448accec7bbc0e72ef38693a29593
Commit:     7c802fbd541448accec7bbc0e72ef38693a29593
Parent:     447d9bd82020f159456ee00b011486205205aaa7
Author:     Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
AuthorDate: Tue May 17 11:13:17 2011 +0300
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Wed May 25 02:05:35 2011 +0100

    mtd: be silent when mtd partition parser cannot be found
    
    Currently when we register partitions in 'parse_mtd_partitions()' we accept the
    list of parsers we should try. And if one of the parsers was not found we print
    a message. Well, first of all this whole idea is bad - look at how many
    'part_probes' and 'part_probe_types' variables we have - nearly every driver
    defines one. Instead, we should just go through all registered parsers all the
    time. But this needs to be worked on separately.
    
    This patch makes life of MTD partitions' users a bit simpler and allows them to
    safely request parsers which have not been registered -
    'parse_mtd_partitions()' will not print a "not available" message in this
    case.
    
    The point is that drivers do not have to do things like this any longer:
    
    static const char *part_probe_types[] = { "cmdlinepart", "RedBoot",
                                             "afs",
                                             NULL };
    
    but can simply do like this:
    
    static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", "afs", NULL };
    
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdpart.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 0a47601..cd631e7 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -722,11 +722,8 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types,
 		parser = get_partition_parser(*types);
 		if (!parser && !request_module("%s", *types))
 				parser = get_partition_parser(*types);
-		if (!parser) {
-			printk(KERN_NOTICE "%s partition parsing not available\n",
-			       *types);
+		if (!parser)
 			continue;
-		}
 		ret = (*parser->parse_fn)(master, pparts, origin);
 		if (ret > 0) {
 			printk(KERN_NOTICE "%d %s partitions found on MTD device %s\n",



More information about the linux-mtd-cvs mailing list