diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:23:35 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:23:54 -0400 |
commit | 5667bc8a5b1ef152cebaf8004026ff6825949116 (patch) | |
tree | 4b5d7344e483f78c32eb31729971aa41a7aeb978 | |
parent | 6baed700f21c9b200e344518932a7046b05853a4 (diff) |
mtd: socrates_nand: 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>
-rw-r--r-- | drivers/mtd/nand/socrates_nand.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c index a853548986f0..ca2d0555729e 100644 --- a/drivers/mtd/nand/socrates_nand.c +++ b/drivers/mtd/nand/socrates_nand.c | |||
@@ -155,9 +155,7 @@ static int socrates_nand_device_ready(struct mtd_info *mtd) | |||
155 | return 1; | 155 | return 1; |
156 | } | 156 | } |
157 | 157 | ||
158 | #ifdef CONFIG_MTD_PARTITIONS | ||
159 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 158 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
160 | #endif | ||
161 | 159 | ||
162 | /* | 160 | /* |
163 | * Probe for the NAND device. | 161 | * Probe for the NAND device. |
@@ -168,11 +166,8 @@ static int __devinit socrates_nand_probe(struct platform_device *ofdev) | |||
168 | struct mtd_info *mtd; | 166 | struct mtd_info *mtd; |
169 | struct nand_chip *nand_chip; | 167 | struct nand_chip *nand_chip; |
170 | int res; | 168 | int res; |
171 | |||
172 | #ifdef CONFIG_MTD_PARTITIONS | ||
173 | struct mtd_partition *partitions = NULL; | 169 | struct mtd_partition *partitions = NULL; |
174 | int num_partitions = 0; | 170 | int num_partitions = 0; |
175 | #endif | ||
176 | 171 | ||
177 | /* Allocate memory for the device structure (and zero it) */ | 172 | /* Allocate memory for the device structure (and zero it) */ |
178 | host = kzalloc(sizeof(struct socrates_nand_host), GFP_KERNEL); | 173 | host = kzalloc(sizeof(struct socrates_nand_host), GFP_KERNEL); |
@@ -230,7 +225,6 @@ static int __devinit socrates_nand_probe(struct platform_device *ofdev) | |||
230 | goto out; | 225 | goto out; |
231 | } | 226 | } |
232 | 227 | ||
233 | #ifdef CONFIG_MTD_PARTITIONS | ||
234 | #ifdef CONFIG_MTD_CMDLINE_PARTS | 228 | #ifdef CONFIG_MTD_CMDLINE_PARTS |
235 | num_partitions = parse_mtd_partitions(mtd, part_probes, | 229 | num_partitions = parse_mtd_partitions(mtd, part_probes, |
236 | &partitions, 0); | 230 | &partitions, 0); |
@@ -240,7 +234,6 @@ static int __devinit socrates_nand_probe(struct platform_device *ofdev) | |||
240 | } | 234 | } |
241 | #endif | 235 | #endif |
242 | 236 | ||
243 | #ifdef CONFIG_MTD_OF_PARTS | ||
244 | if (num_partitions == 0) { | 237 | if (num_partitions == 0) { |
245 | num_partitions = of_mtd_parse_partitions(&ofdev->dev, | 238 | num_partitions = of_mtd_parse_partitions(&ofdev->dev, |
246 | ofdev->dev.of_node, | 239 | ofdev->dev.of_node, |
@@ -250,19 +243,12 @@ static int __devinit socrates_nand_probe(struct platform_device *ofdev) | |||
250 | goto release; | 243 | goto release; |
251 | } | 244 | } |
252 | } | 245 | } |
253 | #endif | ||
254 | if (partitions && (num_partitions > 0)) | ||
255 | res = add_mtd_partitions(mtd, partitions, num_partitions); | ||
256 | else | ||
257 | #endif | ||
258 | res = add_mtd_device(mtd); | ||
259 | 246 | ||
247 | res = mtd_device_register(mtd, partitions, num_partitions); | ||
260 | if (!res) | 248 | if (!res) |
261 | return res; | 249 | return res; |
262 | 250 | ||
263 | #ifdef CONFIG_MTD_PARTITIONS | ||
264 | release: | 251 | release: |
265 | #endif | ||
266 | nand_release(mtd); | 252 | nand_release(mtd); |
267 | 253 | ||
268 | out: | 254 | out: |