Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1280766 > unrolled thread

[PATCH v2 14/25] staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip

Started byBoris Brezillon <boris.brezillon@free-electrons.com>
First post2015-12-01 12:10 +0100
Last post2015-12-01 12:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 14/25] staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip Boris Brezillon <boris.brezillon@free-electrons.com> - 2015-12-01 12:10 +0100

#1280766 — [PATCH v2 14/25] staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2015-12-01 12:10 +0100
Subject[PATCH v2 14/25] staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip
Message-ID<qAQYO-nS-29@gated-at.bofh.it>
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>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web