public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: plat_nand: fix `bbt_options' compile error
@ 2011-08-08 18:26 Brian Norris
  2011-08-16 13:46 ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2011-08-08 18:26 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: Brian Norris, Linux Kernel, linux-mtd, axel.lin, avorontsov,
	David Woodhouse

This fixes a bug in commit 86cb232d4e6b589be3daef8d570d1921c05be962
("mtd: nand: consolidate redundant flash-based BBT flags"). The problem
was reported by Axel Lin at:

  http://lists.infradead.org/pipermail/linux-mtd/2011-August/037340.html

In restructuring a few of the fields in `struct nand_chip' and similar, I
overlooked my reference to a field in `struct platform_nand_chip' that
didn't exist. He discovered the bug via an ARM build that I didn't test:

  make orion5x_defconfig
  make

    CC      arch/arm/mach-orion5x/ts78xx-setup.o
  arch/arm/mach-orion5x/ts78xx-setup.c:278: error: unknown field 'bbt_options' specified in initializer
  make[1]: *** [arch/arm/mach-orion5x/ts78xx-setup.o] Error 1
  make: *** [arch/arm/mach-orion5x] Error 2

The fix is simply to add the new `bbt_options' field to
`platform_nand_chip' and to pass those options on to `nand_chip' during
its initialization.

I re-reviewed the rest of my previous commit and didn't find any other
similar errors.

Based on:

  git://git.infradead.org/users/dedekind/l2-mtd-2.6.git

Reported-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/plat_nand.c |    1 +
 include/linux/mtd/nand.h     |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index e62468b..ea8e123 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -77,6 +77,7 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
 	data->chip.read_buf = pdata->ctrl.read_buf;
 	data->chip.chip_delay = pdata->chip.chip_delay;
 	data->chip.options |= pdata->chip.options;
+	data->chip.bbt_options |= pdata->chip.bbt_options;
 
 	data->chip.ecc.hwctl = pdata->ctrl.hwcontrol;
 	data->chip.ecc.layout = pdata->chip.ecclayout;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index ebd806f..f4fdb1e 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -604,6 +604,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
  * @partitions:		mtd partition list
  * @chip_delay:		R/B delay value in us
  * @options:		Option flags, e.g. 16bit buswidth
+ * @bbt_options:	BBT option flags, e.g. NAND_BBT_USE_FLASH
  * @ecclayout:		ECC layout info structure
  * @part_probe_types:	NULL-terminated array of probe types
  */
@@ -615,6 +616,7 @@ struct platform_nand_chip {
 	struct nand_ecclayout *ecclayout;
 	int chip_delay;
 	unsigned int options;
+	unsigned int bbt_options;
 	const char **part_probe_types;
 };
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: plat_nand: fix `bbt_options' compile error
  2011-08-08 18:26 [PATCH] mtd: plat_nand: fix `bbt_options' compile error Brian Norris
@ 2011-08-16 13:46 ` Artem Bityutskiy
  2011-08-16 22:15   ` Brian Norris
  0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2011-08-16 13:46 UTC (permalink / raw)
  To: Brian Norris
  Cc: David Woodhouse, axel.lin, avorontsov, linux-mtd, Linux Kernel

On Mon, 2011-08-08 at 11:26 -0700, Brian Norris wrote:
> This fixes a bug in commit 86cb232d4e6b589be3daef8d570d1921c05be962
> ("mtd: nand: consolidate redundant flash-based BBT flags"). The problem
> was reported by Axel Lin at:

Merged this fix with that commit in the l2-mtd-2.6.git tree, thanks!

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: plat_nand: fix `bbt_options' compile error
  2011-08-16 13:46 ` Artem Bityutskiy
@ 2011-08-16 22:15   ` Brian Norris
  2011-08-17  4:57     ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2011-08-16 22:15 UTC (permalink / raw)
  To: dedekind1; +Cc: David Woodhouse, axel.lin, avorontsov, linux-mtd, Linux Kernel

On Tue, Aug 16, 2011 at 6:46 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> Merged this fix with that commit in the l2-mtd-2.6.git tree, thanks!

I don't see any "merge." Perhaps an oversight on the push?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: plat_nand: fix `bbt_options' compile error
  2011-08-16 22:15   ` Brian Norris
@ 2011-08-17  4:57     ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2011-08-17  4:57 UTC (permalink / raw)
  To: Brian Norris
  Cc: David Woodhouse, axel.lin, avorontsov, linux-mtd, Linux Kernel

On Tue, 2011-08-16 at 15:15 -0700, Brian Norris wrote:
> On Tue, Aug 16, 2011 at 6:46 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > Merged this fix with that commit in the l2-mtd-2.6.git tree, thanks!
> 
> I don't see any "merge." Perhaps an oversight on the push?

Yes, fixed.

-- 
Best Regards,
Artem Bityutskiy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-17  4:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 18:26 [PATCH] mtd: plat_nand: fix `bbt_options' compile error Brian Norris
2011-08-16 13:46 ` Artem Bityutskiy
2011-08-16 22:15   ` Brian Norris
2011-08-17  4:57     ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox