Patchwork gen_nand: Fix support for multiple chips

login
register
mail settings
Submitter Marek Vasut
Date July 28, 2010, 5:36 a.m.
Message ID <1280295414-3354-1-git-send-email-marek.vasut@gmail.com>
Download mbox | patch
Permalink /patch/60084/
State Accepted
Commit 81cbb0b17796d81cbd92defe113cf2a7c7a21fbb
Headers show

Comments

Marek Vasut - July 28, 2010, 5:36 a.m.
This patch corrects a problem where gen_nand driver assumed there can be only
one chip and ignored the pdata->chip.nr_chips value.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 drivers/mtd/nand/plat_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - Aug. 5, 2010, 4:35 a.m.
On Wed, 2010-07-28 at 07:36 +0200, Marek Vasut wrote:
> This patch corrects a problem where gen_nand driver assumed there can be only
> one chip and ignored the pdata->chip.nr_chips value.
> 
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>

Pushed to my l2-mtd-2.6.git / master

Patch

diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 8d46731..90e143e 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -91,7 +91,7 @@  static int __devinit plat_nand_probe(struct platform_device *pdev)
 	}
 
 	/* Scan to find existance of the device */
-	if (nand_scan(&data->mtd, 1)) {
+	if (nand_scan(&data->mtd, pdata->chip.nr_chips)) {
 		err = -ENXIO;
 		goto out;
 	}