mtd: ofpart: don't complain about missing 'partitions' node too loudly
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Tue Dec 8 17:59:02 PST 2015
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=8c62b4e118cfa7a3c906c01d4ba2c78a5bd97531
Commit: 8c62b4e118cfa7a3c906c01d4ba2c78a5bd97531
Parent: 1ddaa021b000220b5f2ad023e4f15ed44990974b
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Thu Dec 3 14:26:52 2015 -0800
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Dec 3 17:50:36 2015 -0800
mtd: ofpart: don't complain about missing 'partitions' node too loudly
The ofpart partition parser might be run on DT-enabled systems that
don't have any "ofpart" partition subnodes at all, since "ofpart" is in
the default parser list. So don't complain loudly on every boot.
Example: using m25p80.c with no intent to use ofpart:
&spi2 {
status = "okay";
flash at 0 {
compatible = "jedec,spi-nor";
reg = <0>;
};
};
I see this warning:
[ 0.588471] m25p80 spi2.0: gd25q32 (4096 Kbytes)
[ 0.593091] spi2.0: 'partitions' subnode not found on /spi at ff130000/flash at 0. Trying to parse direct subnodes as partitions.
Cc: Michal Suchanek <hramrach at gmail.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/ofpart.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 669c345..3e9c585 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -46,8 +46,13 @@ static int parse_ofpart_partitions(struct mtd_info *master,
ofpart_node = of_get_child_by_name(mtd_node, "partitions");
if (!ofpart_node) {
- pr_warn("%s: 'partitions' subnode not found on %s. Trying to parse direct subnodes as partitions.\n",
- master->name, mtd_node->full_name);
+ /*
+ * We might get here even when ofpart isn't used at all (e.g.,
+ * when using another parser), so don't be louder than
+ * KERN_DEBUG
+ */
+ pr_debug("%s: 'partitions' subnode not found on %s. Trying to parse direct subnodes as partitions.\n",
+ master->name, mtd_node->full_name);
ofpart_node = mtd_node;
dedicated = false;
}
More information about the linux-mtd-cvs
mailing list