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: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
2d3743944a
commit
ba4ed8605c
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue