[PATCH 5/7] nand: fix build error when BBT not enabled.
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Sun Jul 29 05:58:16 EDT 2012
On 17:41 Sun 29 Jul , Marc Reilly wrote:
> This fixes following error when bad blocks config option is not enabled:
>
> drivers/built-in.o: In function `nand_erase_nand':
> drivers/mtd/nand/nand_write.c:721: undefined reference to `nand_update_bbt'
> drivers/built-in.o: In function `nand_default_block_markbad':
> drivers/mtd/nand/nand_write.c:76: undefined reference to `nand_update_bbt'
> make: *** [barebox] Error 1
>
> Signed-off-by: Marc Reilly <marc at cpdesign.com.au>
> ---
> drivers/mtd/nand/nand_write.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_write.c b/drivers/mtd/nand/nand_write.c
> index 13b6c89..0fd49d6 100644
> --- a/drivers/mtd/nand/nand_write.c
> +++ b/drivers/mtd/nand/nand_write.c
> @@ -72,9 +72,15 @@ int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
> chip->bbt[block >> 2] |= 0x01 << ((block & 0x03) << 1);
>
> /* Do we have a flash based bad block table ? */
> - if (chip->options & NAND_USE_FLASH_BBT)
> + if (chip->options & NAND_USE_FLASH_BBT) {
> +#if defined(CONFIG_NAND_BBT)
use if (IS_ENABLED())
Best Regards,
J.
More information about the barebox
mailing list