Commit 599501a7 authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Artem Bityutskiy

mtd: s3c2410.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: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent ee0f6a15
...@@ -748,21 +748,11 @@ static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, ...@@ -748,21 +748,11 @@ static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info,
struct s3c2410_nand_mtd *mtd, struct s3c2410_nand_mtd *mtd,
struct s3c2410_nand_set *set) struct s3c2410_nand_set *set)
{ {
struct mtd_partition *part_info; if (set)
int nr_part = 0;
if (set == NULL)
return mtd_device_register(&mtd->mtd, NULL, 0);
mtd->mtd.name = set->name; mtd->mtd.name = set->name;
nr_part = parse_mtd_partitions(&mtd->mtd, NULL, &part_info, 0);
if (nr_part <= 0 && set->nr_partitions > 0) {
nr_part = set->nr_partitions;
part_info = set->partitions;
}
return mtd_device_register(&mtd->mtd, part_info, nr_part); return mtd_device_parse_register(&mtd->mtd, NULL, 0,
set->partitions, set->nr_partitions);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment