[PATCH 10/10] mtd nand omap: use NAND_OWN_BUFFERS option

Sascha Hauer s.hauer at pengutronix.de
Tue Nov 8 08:01:53 EST 2011


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/mtd/nand/nand_omap_gpmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index 765a0d6..d5e642a 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -765,9 +765,6 @@ static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo,
 
 	oinfo->ecc_mode = mode;
 
-	if (nand->buffers)
-		kfree(nand->buffers);
-
 	/* second phase scan */
 	if (nand_scan_tail(minfo))
 		return -ENXIO;
@@ -897,6 +894,9 @@ static int gpmc_nand_probe(struct device_d *pdev)
 	/* Dont do a bbt scan at the start */
 	nand->options |= NAND_SKIP_BBTSCAN;
 
+	nand->options |= NAND_OWN_BUFFERS;
+	nand->buffers = xzalloc(sizeof(*nand->buffers));
+
 	/* State my controller */
 	nand->controller = &oinfo->controller;
 
-- 
1.7.7




More information about the barebox mailing list