mtd: mtdpart: add debug prints to partition parser.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 6 10:59:11 PST 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=8e2c992b59fcb5e56e3667f5c30c7d26fbbf14a2
Commit:     8e2c992b59fcb5e56e3667f5c30c7d26fbbf14a2
Parent:     eb042ec35956de2684de2a05a814cd15efe570ca
Author:     Michal Suchanek <hramrach at gmail.com>
AuthorDate: Tue Aug 18 15:34:07 2015 +0000
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Sun Oct 11 12:58:28 2015 -0700

    mtd: mtdpart: add debug prints to partition parser.
    
    The probe of a mtd device can fail when a partition parser returns
    error. The failure due to partition parsing can be quite mysterious when
    multiple partitioning schemes are compiled in and any of them can fail
    the probe.
    
    Add debug prints which show what parsers were tried and what they
    returned.
    
    Signed-off-by: Michal Suchanek <hramrach at gmail.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/mtdpart.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 919a936..f5279ea 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -761,12 +761,17 @@ int parse_mtd_partitions(struct mtd_info *master, const char *const *types,
 		types = default_mtd_part_types;
 
 	for ( ; ret <= 0 && *types; types++) {
+		pr_debug("%s: parsing partitions %s\n", master->name, *types);
 		parser = get_partition_parser(*types);
 		if (!parser && !request_module("%s", *types))
 			parser = get_partition_parser(*types);
+		pr_debug("%s: got parser %s\n", master->name,
+			 parser ? parser->name : NULL);
 		if (!parser)
 			continue;
 		ret = (*parser->parse_fn)(master, pparts, data);
+		pr_debug("%s: parser %s: %i\n",
+			 master->name, parser->name, ret);
 		put_partition_parser(parser);
 		if (ret > 0) {
 			printk(KERN_NOTICE "%d %s partitions found on MTD device %s\n",



More information about the linux-mtd-cvs mailing list