diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:23:39 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:24:01 -0400 |
commit | 6b57c11601c8fa4bfa046513c4df155b3b58ea89 (patch) | |
tree | fd33b39c37012ab4f0eb9c21c7d26f3f3de581b9 /drivers | |
parent | ff6e1b26d510b1d3459665c66026977c9e0569b8 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/onenand/samsung.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/mtd/onenand/samsung.c b/drivers/mtd/onenand/samsung.c index a4c74a9ba430..3306b5b3c736 100644 --- a/drivers/mtd/onenand/samsung.c +++ b/drivers/mtd/onenand/samsung.c | |||
@@ -147,9 +147,7 @@ struct s3c_onenand { | |||
147 | struct resource *dma_res; | 147 | struct resource *dma_res; |
148 | unsigned long phys_base; | 148 | unsigned long phys_base; |
149 | struct completion complete; | 149 | struct completion complete; |
150 | #ifdef CONFIG_MTD_PARTITIONS | ||
151 | struct mtd_partition *parts; | 150 | struct mtd_partition *parts; |
152 | #endif | ||
153 | }; | 151 | }; |
154 | 152 | ||
155 | #define CMD_MAP_00(dev, addr) (dev->cmd_map(MAP_00, ((addr) << 1))) | 153 | #define CMD_MAP_00(dev, addr) (dev->cmd_map(MAP_00, ((addr) << 1))) |
@@ -159,9 +157,7 @@ struct s3c_onenand { | |||
159 | 157 | ||
160 | static struct s3c_onenand *onenand; | 158 | static struct s3c_onenand *onenand; |
161 | 159 | ||
162 | #ifdef CONFIG_MTD_PARTITIONS | ||
163 | static const char *part_probes[] = { "cmdlinepart", NULL, }; | 160 | static const char *part_probes[] = { "cmdlinepart", NULL, }; |
164 | #endif | ||
165 | 161 | ||
166 | static inline int s3c_read_reg(int offset) | 162 | static inline int s3c_read_reg(int offset) |
167 | { | 163 | { |
@@ -1021,15 +1017,13 @@ static int s3c_onenand_probe(struct platform_device *pdev) | |||
1021 | if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ) | 1017 | if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ) |
1022 | dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n"); | 1018 | dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n"); |
1023 | 1019 | ||
1024 | #ifdef CONFIG_MTD_PARTITIONS | ||
1025 | err = parse_mtd_partitions(mtd, part_probes, &onenand->parts, 0); | 1020 | err = parse_mtd_partitions(mtd, part_probes, &onenand->parts, 0); |
1026 | if (err > 0) | 1021 | if (err > 0) |
1027 | add_mtd_partitions(mtd, onenand->parts, err); | 1022 | mtd_device_register(mtd, onenand->parts, err); |
1028 | else if (err <= 0 && pdata && pdata->parts) | 1023 | 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); |
1030 | else | 1025 | else |
1031 | #endif | 1026 | err = mtd_device_register(mtd, NULL, 0); |
1032 | err = add_mtd_device(mtd); | ||
1033 | 1027 | ||
1034 | platform_set_drvdata(pdev, mtd); | 1028 | platform_set_drvdata(pdev, mtd); |
1035 | 1029 | ||