Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3af55a89 authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Artem Bityutskiy
Browse files

mtd: sharpsl.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 599501a7
Loading
Loading
Loading
Loading
+2 −9
Original line number Original line Diff line number Diff line
@@ -109,8 +109,6 @@ static int sharpsl_nand_calculate_ecc(struct mtd_info *mtd, const u_char * dat,
static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
{
{
	struct nand_chip *this;
	struct nand_chip *this;
	struct mtd_partition *sharpsl_partition_info;
	int nr_partitions;
	struct resource *r;
	struct resource *r;
	int err = 0;
	int err = 0;
	struct sharpsl_nand *sharpsl;
	struct sharpsl_nand *sharpsl;
@@ -182,14 +180,9 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)


	/* Register the partitions */
	/* Register the partitions */
	sharpsl->mtd.name = "sharpsl-nand";
	sharpsl->mtd.name = "sharpsl-nand";
	nr_partitions = parse_mtd_partitions(&sharpsl->mtd, NULL, &sharpsl_partition_info, 0);
	if (nr_partitions <= 0) {
		nr_partitions = data->nr_partitions;
		sharpsl_partition_info = data->partitions;
	}


	err = mtd_device_register(&sharpsl->mtd, sharpsl_partition_info,
	err = mtd_device_parse_register(&sharpsl->mtd, NULL, 0,
				  nr_partitions);
			data->partitions, data->nr_partitions);
	if (err)
	if (err)
		goto err_add;
		goto err_add;