Skip to content

Commit

Permalink
mtd: omap2 onenand: convert to mtd_device_register()
Browse files Browse the repository at this point in the history
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Jamie Iles authored and David Woodhouse committed May 25, 2011
1 parent c52840f commit ff6e1b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/mtd/onenand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ struct omap2_onenand {
struct regulator *regulator;
};

#ifdef CONFIG_MTD_PARTITIONS
static const char *part_probes[] = { "cmdlinepart", NULL, };
#endif

static void omap2_onenand_dma_cb(int lch, u16 ch_status, void *data)
{
Expand Down Expand Up @@ -755,15 +753,13 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
if ((r = onenand_scan(&c->mtd, 1)) < 0)
goto err_release_regulator;

#ifdef CONFIG_MTD_PARTITIONS
r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0);
if (r > 0)
r = add_mtd_partitions(&c->mtd, c->parts, r);
r = mtd_device_register(&c->mtd, c->parts, r);
else if (pdata->parts != NULL)
r = add_mtd_partitions(&c->mtd, pdata->parts, pdata->nr_parts);
r = mtd_device_register(&c->mtd, pdata->parts, pdata->nr_parts);
else
#endif
r = add_mtd_device(&c->mtd);
r = mtd_device_register(&c->mtd, NULL, 0);
if (r)
goto err_release_onenand;

Expand Down

0 comments on commit ff6e1b2

Please sign in to comment.