提交 6a7c7334 编写于 作者: B Brian Norris

mtd: diskonchip: remove two-phase partitioning / registration

It is a Bad Idea (TM) to call mtd_device_register() or
mtd_device_parse_register() twice on the same master MTD. Among other
things, it makes partition overrides (e.g., cmdlinepart) much more
difficult.

Since commit 727dc612 ("mtd: part: Create the master device node
when partitioned"), we now have a config option that accomplishes the
same purpose as the double-registration done in diskonchip.c -- it
forces the master MTD to *always* be registered, while partitions may
optionally show up in addition. Eventually, we might like to make
CONFIG_MTD_PARTITIONED_MASTER into the default, but this could be
disruptive to user-space expectations of MTD numbering, so we'll take
that slowly.
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Alexander Shiyan <shc_work@mail.ru>
上级 e5babdf9
...@@ -1301,10 +1301,7 @@ static int __init nftl_scan_bbt(struct mtd_info *mtd) ...@@ -1301,10 +1301,7 @@ static int __init nftl_scan_bbt(struct mtd_info *mtd)
if (ret) if (ret)
return ret; return ret;
mtd_device_register(mtd, NULL, 0); return mtd_device_register(mtd, parts, no_autopart ? 0 : numparts);
if (!no_autopart)
mtd_device_register(mtd, parts, numparts);
return 0;
} }
static int __init inftl_scan_bbt(struct mtd_info *mtd) static int __init inftl_scan_bbt(struct mtd_info *mtd)
...@@ -1358,10 +1355,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd) ...@@ -1358,10 +1355,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
autopartitioning, but I want to give it more thought. */ autopartitioning, but I want to give it more thought. */
if (!numparts) if (!numparts)
return -EIO; return -EIO;
mtd_device_register(mtd, NULL, 0); return mtd_device_register(mtd, parts, no_autopart ? 0 : numparts);
if (!no_autopart)
mtd_device_register(mtd, parts, numparts);
return 0;
} }
static inline int __init doc2000_init(struct mtd_info *mtd) static inline int __init doc2000_init(struct mtd_info *mtd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册