aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorJamie Iles <jamie@jamieiles.com>2011-05-23 05:23:28 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2011-05-24 21:23:44 -0400
commit1f3a7c626f7e55657255df89fab418714502093a (patch)
tree10325b6c69c2a1cbb45126d9bbd9d6cc3a69953a /drivers/mtd
parent759f1d325c381470a48c666eb2430af4834ef3ee (diff)
mtd: ndfc: 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: 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/mtd')
-rw-r--r--drivers/mtd/nand/ndfc.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 7ba65553d6ad..ea2dea8a9c88 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -42,9 +42,7 @@ struct ndfc_controller {
42 struct nand_chip chip; 42 struct nand_chip chip;
43 int chip_select; 43 int chip_select;
44 struct nand_hw_control ndfc_control; 44 struct nand_hw_control ndfc_control;
45#ifdef CONFIG_MTD_PARTITIONS
46 struct mtd_partition *parts; 45 struct mtd_partition *parts;
47#endif
48}; 46};
49 47
50static struct ndfc_controller ndfc_ctrl[NDFC_MAX_CS]; 48static struct ndfc_controller ndfc_ctrl[NDFC_MAX_CS];
@@ -161,13 +159,11 @@ static int ndfc_verify_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
161static int ndfc_chip_init(struct ndfc_controller *ndfc, 159static int ndfc_chip_init(struct ndfc_controller *ndfc,
162 struct device_node *node) 160 struct device_node *node)
163{ 161{
164#ifdef CONFIG_MTD_PARTITIONS
165#ifdef CONFIG_MTD_CMDLINE_PARTS 162#ifdef CONFIG_MTD_CMDLINE_PARTS
166 static const char *part_types[] = { "cmdlinepart", NULL }; 163 static const char *part_types[] = { "cmdlinepart", NULL };
167#else 164#else
168 static const char *part_types[] = { NULL }; 165 static const char *part_types[] = { NULL };
169#endif 166#endif
170#endif
171 struct device_node *flash_np; 167 struct device_node *flash_np;
172 struct nand_chip *chip = &ndfc->chip; 168 struct nand_chip *chip = &ndfc->chip;
173 int ret; 169 int ret;
@@ -208,25 +204,18 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
208 if (ret) 204 if (ret)
209 goto err; 205 goto err;
210 206
211#ifdef CONFIG_MTD_PARTITIONS
212 ret = parse_mtd_partitions(&ndfc->mtd, part_types, &ndfc->parts, 0); 207 ret = parse_mtd_partitions(&ndfc->mtd, part_types, &ndfc->parts, 0);
213 if (ret < 0) 208 if (ret < 0)
214 goto err; 209 goto err;
215 210
216#ifdef CONFIG_MTD_OF_PARTS
217 if (ret == 0) { 211 if (ret == 0) {
218 ret = of_mtd_parse_partitions(&ndfc->ofdev->dev, flash_np, 212 ret = of_mtd_parse_partitions(&ndfc->ofdev->dev, flash_np,
219 &ndfc->parts); 213 &ndfc->parts);
220 if (ret < 0) 214 if (ret < 0)
221 goto err; 215 goto err;
222 } 216 }
223#endif
224 217
225 if (ret > 0) 218 ret = mtd_device_register(&ndfc->mtd, ndfc->parts, ret);
226 ret = add_mtd_partitions(&ndfc->mtd, ndfc->parts, ret);
227 else
228#endif
229 ret = add_mtd_device(&ndfc->mtd);
230 219
231err: 220err:
232 of_node_put(flash_np); 221 of_node_put(flash_np);