mtd: ndfc.c: use mtd_device_parse_register

Replace custom invocations of parse_mtd_partitions and mtd_device_register
with common mtd_device_parse_register call. This would bring: standard
handling of all errors, fallback to default partitions, etc.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
This commit is contained in:
Dmitry Eremin-Solenikov 2011-06-02 18:00:51 +04:00 коммит произвёл Artem Bityutskiy
Родитель a9093f064e
Коммит a910649708
1 изменённых файлов: 1 добавлений и 6 удалений

Просмотреть файл

@ -42,7 +42,6 @@ struct ndfc_controller {
struct nand_chip chip; struct nand_chip chip;
int chip_select; int chip_select;
struct nand_hw_control ndfc_control; struct nand_hw_control ndfc_control;
struct mtd_partition *parts;
}; };
static struct ndfc_controller ndfc_ctrl[NDFC_MAX_CS]; static struct ndfc_controller ndfc_ctrl[NDFC_MAX_CS];
@ -201,11 +200,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
if (ret) if (ret)
goto err; goto err;
ret = parse_mtd_partitions(&ndfc->mtd, NULL, &ndfc->parts, &ppdata); ret = mtd_device_parse_register(&ndfc->mtd, NULL, &ppdata, NULL, 0);
if (ret < 0)
goto err;
ret = mtd_device_register(&ndfc->mtd, ndfc->parts, ret);
err: err:
of_node_put(flash_np); of_node_put(flash_np);