Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dmitry Eremin-Solenikov and committed by
Artem Bityutskiy
a9106497 a9093f06

+1 -6
+1 -6
drivers/mtd/nand/ndfc.c
··· 42 42 struct nand_chip chip; 43 43 int chip_select; 44 44 struct nand_hw_control ndfc_control; 45 - struct mtd_partition *parts; 46 45 }; 47 46 48 47 static struct ndfc_controller ndfc_ctrl[NDFC_MAX_CS]; ··· 200 201 if (ret) 201 202 goto err; 202 203 203 - ret = parse_mtd_partitions(&ndfc->mtd, NULL, &ndfc->parts, &ppdata); 204 - if (ret < 0) 205 - goto err; 206 - 207 - ret = mtd_device_register(&ndfc->mtd, ndfc->parts, ret); 204 + ret = mtd_device_parse_register(&ndfc->mtd, NULL, &ppdata, NULL, 0); 208 205 209 206 err: 210 207 of_node_put(flash_np);