* [patch/RESEND 2.6.30-rc2 2/3] NAND: minor davinci_nand cleanup
@ 2009-04-22 2:51 David Brownell
2009-05-30 0:15 ` Kevin Hilman
0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2009-04-22 2:51 UTC (permalink / raw)
To: Linux MTD
Cc: Snehaprabha Narnakaje, DaVinci, dwmw2, Thomas Gleixner,
Andrew Morton
From: David Brownell <dbrownell@users.sourceforge.net>
Make the DaVinci NAND driver require platform_data with
board-specific configuration. We can't actually do any
kind of sane job of configuring it otherwise.
Also fix the comment about picking the "best" ECC mode.
We can't do those any more; that relied on knowing what kind
of CPU we're using (they don't all support 4-bit ECC), and
current policy is that drivers not have cpu_is_*() checks.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
RESEND 7-april version -- refreshing against current kernel
Seems appropriate for 2.6.30 merge, but not essential.
drivers/mtd/nand/davinci_nand.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -306,6 +306,10 @@ static int __init nand_davinci_probe(str
uint32_t val;
nand_ecc_modes_t ecc_mode;
+ /* insist on board-specific configuration */
+ if (!pdata)
+ return -ENODEV;
+
/* which external chipselect will we be managing? */
if (pdev->id < 0 || pdev->id > 3)
return -ENODEV;
@@ -351,7 +355,7 @@ static int __init nand_davinci_probe(str
info->chip.select_chip = nand_davinci_select_chip;
/* options such as NAND_USE_FLASH_BBT or 16-bit widths */
- info->chip.options = pdata ? pdata->options : 0;
+ info->chip.options = pdata->options;
info->ioaddr = (uint32_t __force) vaddr;
@@ -360,14 +364,8 @@ static int __init nand_davinci_probe(str
info->mask_chipsel = pdata->mask_chipsel;
/* use nandboot-capable ALE/CLE masks by default */
- if (pdata && pdata->mask_ale)
- info->mask_ale = pdata->mask_cle;
- else
- info->mask_ale = MASK_ALE;
- if (pdata && pdata->mask_cle)
- info->mask_cle = pdata->mask_cle;
- else
- info->mask_cle = MASK_CLE;
+ info->mask_ale = pdata->mask_cle ? : MASK_ALE;
+ info->mask_cle = pdata->mask_cle ? : MASK_CLE;
/* Set address of hardware control function */
info->chip.cmd_ctrl = nand_davinci_hwcontrol;
@@ -377,11 +375,8 @@ static int __init nand_davinci_probe(str
info->chip.read_buf = nand_davinci_read_buf;
info->chip.write_buf = nand_davinci_write_buf;
- /* use board-specific ECC config; else, the best available */
- if (pdata)
- ecc_mode = pdata->ecc_mode;
- else
- ecc_mode = NAND_ECC_HW;
+ /* Use board-specific ECC config */
+ ecc_mode = pdata->ecc_mode;
switch (ecc_mode) {
case NAND_ECC_NONE:
@@ -469,7 +464,7 @@ static int __init nand_davinci_probe(str
info->mtd.name = master_name;
}
- if (mtd_parts_nb <= 0 && pdata) {
+ if (mtd_parts_nb <= 0) {
mtd_parts = pdata->parts;
mtd_parts_nb = pdata->nr_parts;
}
@@ -482,7 +477,7 @@ static int __init nand_davinci_probe(str
info->partitioned = true;
}
- } else if (pdata && pdata->nr_parts) {
+ } else if (pdata->nr_parts) {
dev_warn(&pdev->dev, "ignoring %d default partitions on %s\n",
pdata->nr_parts, info->mtd.name);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch/RESEND 2.6.30-rc2 2/3] NAND: minor davinci_nand cleanup
2009-04-22 2:51 [patch/RESEND 2.6.30-rc2 2/3] NAND: minor davinci_nand cleanup David Brownell
@ 2009-05-30 0:15 ` Kevin Hilman
2009-05-31 12:48 ` Artem Bityutskiy
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2009-05-30 0:15 UTC (permalink / raw)
To: David Brownell; +Cc: dwmw2, DaVinci, Linux MTD, Thomas Gleixner, Andrew Morton
David Brownell <david-b@pacbell.net> writes:
> From: David Brownell <dbrownell@users.sourceforge.net>
>
> Make the DaVinci NAND driver require platform_data with
> board-specific configuration. We can't actually do any
> kind of sane job of configuring it otherwise.
>
> Also fix the comment about picking the "best" ECC mode.
>
> We can't do those any more; that relied on knowing what kind
> of CPU we're using (they don't all support 4-bit ECC), and
> current policy is that drivers not have cpu_is_*() checks.
>
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
AFAICT, this still hasn't been merged yet. In case it helps:
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> RESEND 7-april version -- refreshing against current kernel
> Seems appropriate for 2.6.30 merge, but not essential.
Would be nice to see this in 2.6.31.
Kevin
> drivers/mtd/nand/davinci_nand.c | 27 +++++++++++----------------
> 1 file changed, 11 insertions(+), 16 deletions(-)
>
> --- a/drivers/mtd/nand/davinci_nand.c
> +++ b/drivers/mtd/nand/davinci_nand.c
> @@ -306,6 +306,10 @@ static int __init nand_davinci_probe(str
> uint32_t val;
> nand_ecc_modes_t ecc_mode;
>
> + /* insist on board-specific configuration */
> + if (!pdata)
> + return -ENODEV;
> +
> /* which external chipselect will we be managing? */
> if (pdev->id < 0 || pdev->id > 3)
> return -ENODEV;
> @@ -351,7 +355,7 @@ static int __init nand_davinci_probe(str
> info->chip.select_chip = nand_davinci_select_chip;
>
> /* options such as NAND_USE_FLASH_BBT or 16-bit widths */
> - info->chip.options = pdata ? pdata->options : 0;
> + info->chip.options = pdata->options;
>
> info->ioaddr = (uint32_t __force) vaddr;
>
> @@ -360,14 +364,8 @@ static int __init nand_davinci_probe(str
> info->mask_chipsel = pdata->mask_chipsel;
>
> /* use nandboot-capable ALE/CLE masks by default */
> - if (pdata && pdata->mask_ale)
> - info->mask_ale = pdata->mask_cle;
> - else
> - info->mask_ale = MASK_ALE;
> - if (pdata && pdata->mask_cle)
> - info->mask_cle = pdata->mask_cle;
> - else
> - info->mask_cle = MASK_CLE;
> + info->mask_ale = pdata->mask_cle ? : MASK_ALE;
> + info->mask_cle = pdata->mask_cle ? : MASK_CLE;
>
> /* Set address of hardware control function */
> info->chip.cmd_ctrl = nand_davinci_hwcontrol;
> @@ -377,11 +375,8 @@ static int __init nand_davinci_probe(str
> info->chip.read_buf = nand_davinci_read_buf;
> info->chip.write_buf = nand_davinci_write_buf;
>
> - /* use board-specific ECC config; else, the best available */
> - if (pdata)
> - ecc_mode = pdata->ecc_mode;
> - else
> - ecc_mode = NAND_ECC_HW;
> + /* Use board-specific ECC config */
> + ecc_mode = pdata->ecc_mode;
>
> switch (ecc_mode) {
> case NAND_ECC_NONE:
> @@ -469,7 +464,7 @@ static int __init nand_davinci_probe(str
> info->mtd.name = master_name;
> }
>
> - if (mtd_parts_nb <= 0 && pdata) {
> + if (mtd_parts_nb <= 0) {
> mtd_parts = pdata->parts;
> mtd_parts_nb = pdata->nr_parts;
> }
> @@ -482,7 +477,7 @@ static int __init nand_davinci_probe(str
> info->partitioned = true;
> }
>
> - } else if (pdata && pdata->nr_parts) {
> + } else if (pdata->nr_parts) {
> dev_warn(&pdev->dev, "ignoring %d default partitions on %s\n",
> pdata->nr_parts, info->mtd.name);
> }
>
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch/RESEND 2.6.30-rc2 2/3] NAND: minor davinci_nand cleanup
2009-05-30 0:15 ` Kevin Hilman
@ 2009-05-31 12:48 ` Artem Bityutskiy
0 siblings, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2009-05-31 12:48 UTC (permalink / raw)
To: Kevin Hilman
Cc: DaVinci, David Brownell, Linux MTD, Thomas Gleixner, dwmw2,
Andrew Morton
On Fri, 2009-05-29 at 17:15 -0700, Kevin Hilman wrote:
> David Brownell <david-b@pacbell.net> writes:
>
> > From: David Brownell <dbrownell@users.sourceforge.net>
> >
> > Make the DaVinci NAND driver require platform_data with
> > board-specific configuration. We can't actually do any
> > kind of sane job of configuring it otherwise.
> >
> > Also fix the comment about picking the "best" ECC mode.
> >
> > We can't do those any more; that relied on knowing what kind
> > of CPU we're using (they don't all support 4-bit ECC), and
> > current policy is that drivers not have cpu_is_*() checks.
> >
> > Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
>
> AFAICT, this still hasn't been merged yet. In case it helps:
>
> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
>
> > ---
> > RESEND 7-april version -- refreshing against current kernel
> > Seems appropriate for 2.6.30 merge, but not essential.
>
> Would be nice to see this in 2.6.31.
Yeah, it is in my l2-mtd-2.6.git tree, which means this won't be
forgotten.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-31 12:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-22 2:51 [patch/RESEND 2.6.30-rc2 2/3] NAND: minor davinci_nand cleanup David Brownell
2009-05-30 0:15 ` Kevin Hilman
2009-05-31 12:48 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox