Lines Matching refs:data
36 struct plat_nand_data *data;
50 data = kzalloc(sizeof(struct plat_nand_data), GFP_KERNEL);
51 if (!data) {
63 data->io_base = ioremap(res->start, resource_size(res));
64 if (data->io_base == NULL) {
70 data->chip.priv = &data;
71 data->mtd.priv = &data->chip;
72 data->mtd.owner = THIS_MODULE;
73 data->mtd.name = dev_name(&pdev->dev);
75 data->chip.IO_ADDR_R = data->io_base;
76 data->chip.IO_ADDR_W = data->io_base;
77 data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl;
78 data->chip.dev_ready = pdata->ctrl.dev_ready;
79 data->chip.select_chip = pdata->ctrl.select_chip;
80 data->chip.write_buf = pdata->ctrl.write_buf;
81 data->chip.read_buf = pdata->ctrl.read_buf;
82 data->chip.chip_delay = pdata->chip.chip_delay;
83 data->chip.options |= pdata->chip.options;
85 data->chip.ecc.hwctl = pdata->ctrl.hwcontrol;
86 data->chip.ecc.layout = pdata->chip.ecclayout;
87 data->chip.ecc.mode = NAND_ECC_SOFT;
89 platform_set_drvdata(pdev, data);
99 if (nand_scan(&data->mtd, pdata->chip.nr_chips)) {
106 err = parse_mtd_partitions(&data->mtd,
108 &data->parts, 0);
110 add_mtd_partitions(&data->mtd, data->parts, err);
115 pdata->chip.set_parts(data->mtd.size, &pdata->chip);
117 data->parts = pdata->chip.partitions;
118 err = add_mtd_partitions(&data->mtd, data->parts,
122 err = add_mtd_device(&data->mtd);
127 nand_release(&data->mtd);
132 iounmap(data->io_base);
136 kfree(data);
145 struct plat_nand_data *data = platform_get_drvdata(pdev);
151 nand_release(&data->mtd);
153 if (data->parts && data->parts != pdata->chip.partitions)
154 kfree(data->parts);
158 iounmap(data->io_base);
160 kfree(data);