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

Commit 13c41db9 authored by Jamie Iles's avatar Jamie Iles Committed by David Woodhouse
Browse files

mtd: fsl_upm: convert to mtd_device_register()



Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Signed-off-by: default avatarJamie Iles <jamie@jamieiles.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent ed9281e6
Loading
Loading
Loading
Loading
+1 −11
Original line number Original line Diff line number Diff line
@@ -33,10 +33,7 @@ struct fsl_upm_nand {
	struct mtd_info mtd;
	struct mtd_info mtd;
	struct nand_chip chip;
	struct nand_chip chip;
	int last_ctrl;
	int last_ctrl;
#ifdef CONFIG_MTD_PARTITIONS
	struct mtd_partition *parts;
	struct mtd_partition *parts;
#endif

	struct fsl_upm upm;
	struct fsl_upm upm;
	uint8_t upm_addr_offset;
	uint8_t upm_addr_offset;
	uint8_t upm_cmd_offset;
	uint8_t upm_cmd_offset;
@@ -161,9 +158,7 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
{
{
	int ret;
	int ret;
	struct device_node *flash_np;
	struct device_node *flash_np;
#ifdef CONFIG_MTD_PARTITIONS
	static const char *part_types[] = { "cmdlinepart", NULL, };
	static const char *part_types[] = { "cmdlinepart", NULL, };
#endif


	fun->chip.IO_ADDR_R = fun->io_base;
	fun->chip.IO_ADDR_R = fun->io_base;
	fun->chip.IO_ADDR_W = fun->io_base;
	fun->chip.IO_ADDR_W = fun->io_base;
@@ -197,7 +192,6 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
	if (ret)
	if (ret)
		goto err;
		goto err;


#ifdef CONFIG_MTD_PARTITIONS
	ret = parse_mtd_partitions(&fun->mtd, part_types, &fun->parts, 0);
	ret = parse_mtd_partitions(&fun->mtd, part_types, &fun->parts, 0);


#ifdef CONFIG_MTD_OF_PARTS
#ifdef CONFIG_MTD_OF_PARTS
@@ -207,11 +201,7 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
			goto err;
			goto err;
	}
	}
#endif
#endif
	if (ret > 0)
	ret = mtd_device_register(&fun->mtd, fun->parts, ret);
		ret = add_mtd_partitions(&fun->mtd, fun->parts, ret);
	else
#endif
		ret = add_mtd_device(&fun->mtd);
err:
err:
	of_node_put(flash_np);
	of_node_put(flash_np);
	return ret;
	return ret;