[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <C3050A4DBA34F345975765E43127F10F1C08B3EA@szxeml512-mbs.china.huawei.com>
Date: Sat, 9 Nov 2013 11:43:06 +0000
From: Caizhiyong <caizhiyong@...ilicon.com>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: Brian Norris <computersforpeace@...il.com>,
"Wanglin (Albert)" <albert.wanglin@...ilicon.com>,
Artem Bityutskiy <dedekind1@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
Karel Zak <kzak@...hat.com>,
Shmulik Ladkani <shmulik.ladkani@...il.com>,
Randy Dunlap <rdunlap@...radead.org>,
"fengguang.wu@...el.com" <fengguang.wu@...el.com>
Subject: [PATCH 2/2] mtd: cmdlinepart: support master name is not set when
parser partition
From: Cai Zhiyong <caizhiyong@...wei.com>
Date: Sat, 9 Nov 2013 17:54:12 +0800
Subject: [PATCH 2/2] mtd: cmdlinepart: support master name is not set when parser partition
-Fix compile warning with value and function undeclared.
this reported by <fengguang.wu@...el.com> and
Randy Dunlap <rdunlap@...radead.org>
-support master name is not set when parser partition.
this feature is supported in the old parser.
Signed-off-by: Cai Zhiyong <caizhiyong@...wei.com>
---
drivers/mtd/Kconfig | 1 +
drivers/mtd/cmdlinepart.c | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index daf544a..f8f45e0 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -76,6 +76,7 @@ endif # MTD_REDBOOT_PARTS
config MTD_CMDLINE_PARTS
tristate "Command line partition table parsing"
select BLK_CMDLINE_PARSER
+ depends on BLOCK
depends on MTD
---help---
Allow generic configuration of the MTD partition tables via the kernel
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index ba934a4..2074164 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -54,6 +54,7 @@
*/
#include <linux/kernel.h>
+#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/module.h>
@@ -108,7 +109,12 @@ static int parse_cmdline_partitions(struct mtd_info *master,
if (!mtd_cmdline_parts)
return 0;
- parts = cmdline_parts_find(mtd_cmdline_parts, master->name);
+ /* If master->name is not set, return the first device partition. */
+ if (!master->name)
+ parts = mtd_cmdline_parts->next_parts;
+ else
+ parts = cmdline_parts_find(mtd_cmdline_parts, master->name);
+
if (!parts)
return 0;
@@ -143,5 +149,5 @@ MODULE_PARM_DESC(mtdparts, "Partitioning specification");
module_param(mtdparts, charp, 0);
MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Marius Groeger <mag@...go.de>");
+MODULE_AUTHOR("Cai Zhiyong <caizhiyong@...wei.com>");
MODULE_DESCRIPTION("Command line configuration of MTD partitions");
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists