Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MTD] NAND Fix platform structure and NDFC driver

The platform structure was lacking an oobinfo field.
The NDFC driver had some remains from another tree.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

+7 -6
+2 -4
drivers/mtd/nand/ndfc.c
··· 20 20 #include <linux/mtd/nand_ecc.h> 21 21 #include <linux/mtd/partitions.h> 22 22 #include <linux/mtd/ndfc.h> 23 - #include <linux/mtd/ubi.h> 24 23 #include <linux/mtd/mtd.h> 25 24 #include <linux/platform_device.h> 26 25 ··· 168 169 chip->ecc.mode = NAND_ECC_HW; 169 170 chip->ecc.size = 256; 170 171 chip->ecc.bytes = 3; 171 - chip->autooob = mtd->pl_chip->autooob; 172 + chip->autooob = mtd->pl_chip->oobinfo; 172 173 mtd->mtd.priv = chip; 173 174 mtd->mtd.owner = THIS_MODULE; 174 175 } 175 176 176 177 static int ndfc_chip_probe(struct platform_device *pdev) 177 178 { 178 - int rc; 179 179 struct platform_nand_chip *nc = pdev->dev.platform_data; 180 180 struct ndfc_chip_settings *settings = nc->priv; 181 181 struct ndfc_controller *ndfc = &ndfc_ctrl; ··· 233 235 struct ndfc_controller_settings *settings = nc->priv; 234 236 struct resource *res = pdev->resource; 235 237 struct ndfc_controller *ndfc = &ndfc_ctrl; 236 - unsigned long long phys = NDFC_PHYSADDR_OFFS | res->start; 238 + unsigned long long phys = setting->erpn | res->start; 237 239 238 240 ndfc->ndfcbase = ioremap64(phys, res->end - res->start + 1); 239 241 if (!ndfc->ndfcbase) {
+3 -1
include/linux/mtd/nand.h
··· 518 518 * 519 519 * @nr_chips: max. number of chips to scan for 520 520 * @chip_offs: chip number offset 521 - * @nr_partitions: number of partitions pointed to be partitoons (or zero) 521 + * @nr_partitions: number of partitions pointed to by partitions (or zero) 522 522 * @partitions: mtd partition list 523 523 * @chip_delay: R/B delay value in us 524 524 * @options: Option flags, e.g. 16bit buswidth 525 + * @oobinfo: oob info structure (ecc placement) 525 526 * @priv: hardware controller specific settings 526 527 */ 527 528 struct platform_nand_chip { ··· 530 529 int chip_offset; 531 530 int nr_partitions; 532 531 struct mtd_partition *partitions; 532 + struct nand_oobinfo *oobinfo; 533 533 int chip_delay; 534 534 unsigned int options; 535 535 void *priv;
+2 -1
include/linux/mtd/ndfc.h
··· 56 56 #define NDFC_MAX_BANKS 4 57 57 58 58 struct ndfc_controller_settings { 59 - uint32_t ccr_settings; 59 + uint32_t ccr_settings; 60 + uint64_t ndfc_erpn; 60 61 }; 61 62 62 63 struct ndfc_chip_settings {