diff options
Diffstat (limited to 'drivers')
| -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: |
