diff options
Diffstat (limited to 'drivers/mtd/nand/fsl_upm.c')
| -rw-r--r-- | drivers/mtd/nand/fsl_upm.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c index 23752fd5bc59..b4f3cc9f32fb 100644 --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c | |||
| @@ -158,7 +158,7 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun, | |||
| 158 | { | 158 | { |
| 159 | int ret; | 159 | int ret; |
| 160 | struct device_node *flash_np; | 160 | struct device_node *flash_np; |
| 161 | static const char *part_types[] = { "cmdlinepart", NULL, }; | 161 | struct mtd_part_parser_data ppdata; |
| 162 | 162 | ||
| 163 | fun->chip.IO_ADDR_R = fun->io_base; | 163 | fun->chip.IO_ADDR_R = fun->io_base; |
| 164 | fun->chip.IO_ADDR_W = fun->io_base; | 164 | fun->chip.IO_ADDR_W = fun->io_base; |
| @@ -192,18 +192,12 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun, | |||
| 192 | if (ret) | 192 | if (ret) |
| 193 | goto err; | 193 | goto err; |
| 194 | 194 | ||
| 195 | ret = parse_mtd_partitions(&fun->mtd, part_types, &fun->parts, 0); | 195 | ppdata.of_node = flash_np; |
| 196 | 196 | ret = mtd_device_parse_register(&fun->mtd, NULL, &ppdata, NULL, 0); | |
| 197 | #ifdef CONFIG_MTD_OF_PARTS | ||
| 198 | if (ret == 0) { | ||
| 199 | ret = of_mtd_parse_partitions(fun->dev, flash_np, &fun->parts); | ||
| 200 | if (ret < 0) | ||
| 201 | goto err; | ||
| 202 | } | ||
| 203 | #endif | ||
| 204 | ret = mtd_device_register(&fun->mtd, fun->parts, ret); | ||
| 205 | err: | 197 | err: |
| 206 | of_node_put(flash_np); | 198 | of_node_put(flash_np); |
| 199 | if (ret) | ||
| 200 | kfree(fun->mtd.name); | ||
| 207 | return ret; | 201 | return ret; |
| 208 | } | 202 | } |
| 209 | 203 | ||
