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

mtd: socrates_nand.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
b2a5a487 a9106497

+1 -10
+1 -10
drivers/mtd/nand/socrates_nand.c
··· 164 164 struct mtd_info *mtd; 165 165 struct nand_chip *nand_chip; 166 166 int res; 167 - struct mtd_partition *partitions = NULL; 168 - int num_partitions = 0; 169 167 struct mtd_part_parser_data ppdata; 170 168 171 169 /* Allocate memory for the device structure (and zero it) */ ··· 223 225 goto out; 224 226 } 225 227 226 - num_partitions = parse_mtd_partitions(mtd, NULL, &partitions, &ppdata); 227 - if (num_partitions < 0) { 228 - res = num_partitions; 229 - goto release; 230 - } 231 - 232 - res = mtd_device_register(mtd, partitions, num_partitions); 228 + res = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0); 233 229 if (!res) 234 230 return res; 235 231 236 - release: 237 232 nand_release(mtd); 238 233 239 234 out: