diff options
Diffstat (limited to 'drivers/mtd/nand/plat_nand.c')
-rw-r--r-- | drivers/mtd/nand/plat_nand.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index 6404e6e81b10..1bcb52040422 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c | |||
@@ -23,14 +23,18 @@ struct plat_nand_data { | |||
23 | void __iomem *io_base; | 23 | void __iomem *io_base; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | static const char *part_probe_types[] = { "cmdlinepart", NULL }; | ||
27 | |||
26 | /* | 28 | /* |
27 | * Probe for the NAND device. | 29 | * Probe for the NAND device. |
28 | */ | 30 | */ |
29 | static int __devinit plat_nand_probe(struct platform_device *pdev) | 31 | static int __devinit plat_nand_probe(struct platform_device *pdev) |
30 | { | 32 | { |
31 | struct platform_nand_data *pdata = pdev->dev.platform_data; | 33 | struct platform_nand_data *pdata = pdev->dev.platform_data; |
34 | struct mtd_part_parser_data ppdata; | ||
32 | struct plat_nand_data *data; | 35 | struct plat_nand_data *data; |
33 | struct resource *res; | 36 | struct resource *res; |
37 | const char **part_types; | ||
34 | int err = 0; | 38 | int err = 0; |
35 | 39 | ||
36 | if (pdata->chip.nr_chips < 1) { | 40 | if (pdata->chip.nr_chips < 1) { |
@@ -75,6 +79,7 @@ static int __devinit plat_nand_probe(struct platform_device *pdev) | |||
75 | data->chip.select_chip = pdata->ctrl.select_chip; | 79 | data->chip.select_chip = pdata->ctrl.select_chip; |
76 | data->chip.write_buf = pdata->ctrl.write_buf; | 80 | data->chip.write_buf = pdata->ctrl.write_buf; |
77 | data->chip.read_buf = pdata->ctrl.read_buf; | 81 | data->chip.read_buf = pdata->ctrl.read_buf; |
82 | data->chip.read_byte = pdata->ctrl.read_byte; | ||
78 | data->chip.chip_delay = pdata->chip.chip_delay; | 83 | data->chip.chip_delay = pdata->chip.chip_delay; |
79 | data->chip.options |= pdata->chip.options; | 84 | data->chip.options |= pdata->chip.options; |
80 | data->chip.bbt_options |= pdata->chip.bbt_options; | 85 | data->chip.bbt_options |= pdata->chip.bbt_options; |
@@ -98,8 +103,10 @@ static int __devinit plat_nand_probe(struct platform_device *pdev) | |||
98 | goto out; | 103 | goto out; |
99 | } | 104 | } |
100 | 105 | ||
101 | err = mtd_device_parse_register(&data->mtd, | 106 | part_types = pdata->chip.part_probe_types ? : part_probe_types; |
102 | pdata->chip.part_probe_types, NULL, | 107 | |
108 | ppdata.of_node = pdev->dev.of_node; | ||
109 | err = mtd_device_parse_register(&data->mtd, part_types, &ppdata, | ||
103 | pdata->chip.partitions, | 110 | pdata->chip.partitions, |
104 | pdata->chip.nr_partitions); | 111 | pdata->chip.nr_partitions); |
105 | 112 | ||
@@ -140,12 +147,19 @@ static int __devexit plat_nand_remove(struct platform_device *pdev) | |||
140 | return 0; | 147 | return 0; |
141 | } | 148 | } |
142 | 149 | ||
150 | static const struct of_device_id plat_nand_match[] = { | ||
151 | { .compatible = "gen_nand" }, | ||
152 | {}, | ||
153 | }; | ||
154 | MODULE_DEVICE_TABLE(of, plat_nand_match); | ||
155 | |||
143 | static struct platform_driver plat_nand_driver = { | 156 | static struct platform_driver plat_nand_driver = { |
144 | .probe = plat_nand_probe, | 157 | .probe = plat_nand_probe, |
145 | .remove = __devexit_p(plat_nand_remove), | 158 | .remove = __devexit_p(plat_nand_remove), |
146 | .driver = { | 159 | .driver = { |
147 | .name = "gen_nand", | 160 | .name = "gen_nand", |
148 | .owner = THIS_MODULE, | 161 | .owner = THIS_MODULE, |
162 | .of_match_table = plat_nand_match, | ||
149 | }, | 163 | }, |
150 | }; | 164 | }; |
151 | 165 | ||