Commit ba4ed860 authored by Boris BREZILLON's avatar Boris BREZILLON Committed by Brian Norris

staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip

struct nand_chip now embeds an mtd device, use it instead of allocating
a new one.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 2d374394
......@@ -903,9 +903,7 @@ static int spinand_probe(struct spi_device *spi_nand)
chip->options |= NAND_CACHEPRG;
chip->select_chip = spinand_select_chip;
mtd = devm_kzalloc(&spi_nand->dev, sizeof(struct mtd_info), GFP_KERNEL);
if (!mtd)
return -ENOMEM;
mtd = nand_to_mtd(chip);
dev_set_drvdata(&spi_nand->dev, mtd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment