@@ -170,9 +170,6 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
chip->ecc.strength = 1;
chip->priv = ndfc;
- ndfc->mtd.priv = chip;
- ndfc->mtd.owner = THIS_MODULE;
-
flash_np = of_get_next_child(node, NULL);
if (!flash_np)
return -ENODEV;
@@ -248,6 +245,7 @@ static int ndfc_probe(struct platform_device *ofdev)
out_be32(ndfc->ndfcbase + offset, be32_to_cpup(reg));
}
+ mtd_setup_common_members(&ndfc->mtd, &ndfc->chip, ofdev);
err = ndfc_chip_init(ndfc, ofdev->dev.of_node);
if (err) {
iounmap(ndfc->ndfcbase);
Fix a common error in nand-drivers which do not set up a parent device for the mtd-device by using a new inline function. Signed-off-by: Alexander Holler <holler@ahsoftware.de> --- drivers/mtd/nand/ndfc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)