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

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:25 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=ba4ed8605cb09b2cb72bf14499cf4605a0f9eb23
Commit:     ba4ed8605cb09b2cb72bf14499cf4605a0f9eb23
Parent:     2d3743944a6b425f3a3795a967499c13e0d8856c
Author:     Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Thu Dec 10 09:00:31 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Dec 18 12:44:14 2015 -0800

    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 at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/staging/mt29f_spinand/mt29f_spinand.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c
index 8924a96..8171b74 100644
--- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
+++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
@@ -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);
 



More information about the linux-mtd-cvs mailing list