mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Raphaël Poggi" <poggi.raph@gmail.com>
To: barebox@lists.infradead.org
Cc: "Raphaël Poggi" <poggi.raph@gmail.com>
Subject: [PATCH 1/5] mtd: nand: remove NAND_ATMEL_PMECC
Date: Tue,  5 Aug 2014 11:14:45 +0200	[thread overview]
Message-ID: <1407230089-26948-2-git-send-email-poggi.raph@gmail.com> (raw)
In-Reply-To: <1407230089-26948-1-git-send-email-poggi.raph@gmail.com>

By removing this CONFIG_, we can use a structure member to retrieve the config,
either through the plateform data or through the device tree. So we can handle cases
when the driver is probed using device tree or not.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
---
 arch/arm/mach-at91/include/mach/board.h |    1 +
 drivers/mtd/nand/Kconfig                |    8 --------
 drivers/mtd/nand/atmel_nand.c           |    2 +-
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index aa0fdae..e2307ed 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -63,6 +63,7 @@ struct atmel_nand_data {
 	u8		bus_width_16;	/* buswidth is 16 bit */
 	u8		ecc_mode;	/* NAND_ECC_* */
 	u8		on_flash_bbt;	/* Use flash based bbt */
+	u8		has_pmecc;	/* Use PMECC */
 	u8		bus_on_d0;
 
 	u8		pmecc_corr_cap;
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 04fe3c8..d49eae3 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -95,14 +95,6 @@ config NAND_ATMEL
 	prompt "Atmel (AT91SAM9xxx) NAND driver"
 	depends on ARCH_AT91
 
-config NAND_ATMEL_PMECC
-	bool
-	prompt "PMECC support"
-	depends on NAND_ATMEL
-	select NAND_ECC_HW
-	help
-	  Support for PMECC present on the SoC sam9x5 and sam9n12
-
 config NAND_S3C24XX
 	bool
 	prompt "Samsung S3C24XX NAND driver"
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 337e225..3ec6450 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1219,7 +1219,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
 
 	if (IS_ENABLED(CONFIG_NAND_ECC_HW) &&
 	    nand_chip->ecc.mode == NAND_ECC_HW) {
-		if (IS_ENABLED(CONFIG_NAND_ATMEL_PMECC))
+		if (pdata->has_pmecc)
 			res = atmel_pmecc_nand_init_params(dev, host);
 		else
 			res = atmel_hw_nand_init_params(dev, host);
-- 
1.7.9.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-08-05  9:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05  9:14 [PATCH v2 0/5] Add device tree support of Atmel NAND driver Raphaël Poggi
2014-08-05  9:14 ` Raphaël Poggi [this message]
2014-08-06  4:08   ` [PATCH 1/5] mtd: nand: remove NAND_ATMEL_PMECC Jean-Christophe PLAGNIOL-VILLARD
2014-08-06  7:21     ` Raphaël Poggi
2014-09-01  9:49       ` Sascha Hauer
2014-08-05  9:14 ` [PATCH 2/5] board: atmel: initialise the has_pmecc member Raphaël Poggi
2014-08-05  9:14 ` [PATCH 3/5] mtd: atmel_nand: retrieve ecc_mode from pdata Raphaël Poggi
2014-08-05  9:14 ` [PATCH 4/5] board: atmel: initialise ecc_mode Raphaël Poggi
2014-09-01  9:54   ` Sascha Hauer
2014-08-05  9:14 ` [PATCH 5/5] mtd: atmel_nand: add support for device tree Raphaël Poggi
2014-08-05  9:40 ` [PATCH v2 0/5] Add device tree support of Atmel NAND driver Raphaël Poggi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407230089-26948-2-git-send-email-poggi.raph@gmail.com \
    --to=poggi.raph@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox