13 #include <linux/module.h>
15 #include <linux/slab.h>
26 static const char *part_probe_types[] = {
"cmdlinepart",
NULL };
37 const char **part_types;
41 dev_err(&pdev->
dev,
"platform_nand_data is missing\n");
45 if (pdata->
chip.nr_chips < 1) {
46 dev_err(&pdev->
dev,
"invalid number of chips specified\n");
57 dev_err(&pdev->
dev,
"failed to allocate device structure.\n");
62 dev_name(&pdev->
dev))) {
63 dev_err(&pdev->
dev,
"request_mem_region failed\n");
78 data->
mtd.name = dev_name(&pdev->
dev);
82 data->
chip.cmd_ctrl = pdata->
ctrl.cmd_ctrl;
83 data->
chip.dev_ready = pdata->
ctrl.dev_ready;
84 data->
chip.select_chip = pdata->
ctrl.select_chip;
85 data->
chip.write_buf = pdata->
ctrl.write_buf;
86 data->
chip.read_buf = pdata->
ctrl.read_buf;
87 data->
chip.read_byte = pdata->
ctrl.read_byte;
88 data->
chip.chip_delay = pdata->
chip.chip_delay;
89 data->
chip.options |= pdata->
chip.options;
90 data->
chip.bbt_options |= pdata->
chip.bbt_options;
92 data->
chip.ecc.hwctl = pdata->
ctrl.hwcontrol;
93 data->
chip.ecc.layout = pdata->
chip.ecclayout;
96 platform_set_drvdata(pdev, data);
99 if (pdata->
ctrl.probe) {
100 err = pdata->
ctrl.probe(pdev);
111 part_types = pdata->
chip.part_probe_types ? : part_probe_types;
115 pdata->
chip.partitions,
116 pdata->
chip.nr_partitions);
123 if (pdata->
ctrl.remove)
124 pdata->
ctrl.remove(pdev);
125 platform_set_drvdata(pdev,
NULL);
146 if (pdata->
ctrl.remove)
147 pdata->
ctrl.remove(pdev);
156 { .compatible =
"gen_nand" },
162 .probe = plat_nand_probe,
167 .of_match_table = plat_nand_match,