Thread (79 messages) 79 messages, 5 authors, 2016-01-07
STALE3851d

[PATCH v4 47/58] staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip

From: Boris Brezillon <hidden>
Date: 2015-12-10 08:09:19
Also in: linux-omap, linux-samsung-soc, lkml
Subsystem: staging subsystem, the rest · Maintainers: Greg Kroah-Hartman, Linus Torvalds

struct nand_chip now embeds an mtd device, use it instead of allocating
a new one.

Signed-off-by: Boris Brezillon <redacted>
---
 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);
 
-- 
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help