Skip to content

Commit 6b57c11

Browse files
jamieilesDavid Woodhouse
authored andcommitted
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: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent ff6e1b2 commit 6b57c11

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎drivers/mtd/onenand/samsung.c‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ struct s3c_onenand {
147147
struct resource *dma_res;
148148
unsigned long phys_base;
149149
struct completion complete;
150-
#ifdef CONFIG_MTD_PARTITIONS
151150
struct mtd_partition *parts;
152-
#endif
153151
};
154152

155153
#define CMD_MAP_00(dev, addr) (dev->cmd_map(MAP_00, ((addr) << 1)))
@@ -159,9 +157,7 @@ struct s3c_onenand {
159157

160158
static struct s3c_onenand *onenand;
161159

162-
#ifdef CONFIG_MTD_PARTITIONS
163160
static const char *part_probes[] = { "cmdlinepart", NULL, };
164-
#endif
165161

166162
static inline int s3c_read_reg(int offset)
167163
{
@@ -1021,15 +1017,13 @@ static int s3c_onenand_probe(struct platform_device *pdev)
10211017
if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ)
10221018
dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n");
10231019

1024-
#ifdef CONFIG_MTD_PARTITIONS
10251020
err = parse_mtd_partitions(mtd, part_probes, &onenand->parts, 0);
10261021
if (err > 0)
1027-
add_mtd_partitions(mtd, onenand->parts, err);
1022+
mtd_device_register(mtd, onenand->parts, err);
10281023
else if (err <= 0 && pdata && pdata->parts)
1029-
add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
1024+
mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
10301025
else
1031-
#endif
1032-
err = add_mtd_device(mtd);
1026+
err = mtd_device_register(mtd, NULL, 0);
10331027

10341028
platform_set_drvdata(pdev, mtd);
10351029

0 commit comments

Comments
 (0)