Commit 6b57c116 authored by Jamie Iles's avatar Jamie Iles Committed by David Woodhouse

mtd: samsung onenand: convert to mtd_device_register()

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: 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 ff6e1b26
...@@ -147,9 +147,7 @@ struct s3c_onenand { ...@@ -147,9 +147,7 @@ struct s3c_onenand {
struct resource *dma_res; struct resource *dma_res;
unsigned long phys_base; unsigned long phys_base;
struct completion complete; struct completion complete;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *parts; struct mtd_partition *parts;
#endif
}; };
#define CMD_MAP_00(dev, addr) (dev->cmd_map(MAP_00, ((addr) << 1))) #define CMD_MAP_00(dev, addr) (dev->cmd_map(MAP_00, ((addr) << 1)))
...@@ -159,9 +157,7 @@ struct s3c_onenand { ...@@ -159,9 +157,7 @@ struct s3c_onenand {
static struct s3c_onenand *onenand; static struct s3c_onenand *onenand;
#ifdef CONFIG_MTD_PARTITIONS
static const char *part_probes[] = { "cmdlinepart", NULL, }; static const char *part_probes[] = { "cmdlinepart", NULL, };
#endif
static inline int s3c_read_reg(int offset) static inline int s3c_read_reg(int offset)
{ {
...@@ -1021,15 +1017,13 @@ static int s3c_onenand_probe(struct platform_device *pdev) ...@@ -1021,15 +1017,13 @@ static int s3c_onenand_probe(struct platform_device *pdev)
if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ) if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ)
dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n"); dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n");
#ifdef CONFIG_MTD_PARTITIONS
err = parse_mtd_partitions(mtd, part_probes, &onenand->parts, 0); err = parse_mtd_partitions(mtd, part_probes, &onenand->parts, 0);
if (err > 0) if (err > 0)
add_mtd_partitions(mtd, onenand->parts, err); mtd_device_register(mtd, onenand->parts, err);
else if (err <= 0 && pdata && pdata->parts) else if (err <= 0 && pdata && pdata->parts)
add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts); mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
else else
#endif err = mtd_device_register(mtd, NULL, 0);
err = add_mtd_device(mtd);
platform_set_drvdata(pdev, mtd); platform_set_drvdata(pdev, mtd);
......
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