lkml.org 
[lkml]   [2016]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 05/12] mtd: nand: use new BBT API instead of old ones
On Tue, 15 Dec 2015 05:59:31 +0000
Peter Pan <peterpansjtu@gmail.com> wrote:

> From: Brian Norris <computersforpeace@gmail.com>
>
> Use new BBT APIs (nand_bbt_*()) in NAND. Keep old APIs (nand_*_bbt())
> exist temporarily.
>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> [Peter: 1. use nand_bbt_markbad_factory() in docg4.c and implement
> 2. nand_create_factory_badblock_pattern(), nand_is_bad_bbm() and
> nand_default_bbt() in nand_base.c
> 3. add NAND_BADBLOCK_PATTERN_ALLOC macro]
> Signed-off-by: Peter Pan <peterpandong@micron.com>
> ---
> drivers/mtd/nand/docg4.c | 6 +-
> drivers/mtd/nand/nand_base.c | 140 ++++++++++++++++++++++++++++++++++++++++---
> include/linux/mtd/nand.h | 9 ++-
> 3 files changed, 143 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
> index da93d7f..1be7fa2 100644
> --- a/drivers/mtd/nand/docg4.c
> +++ b/drivers/mtd/nand/docg4.c
> @@ -1037,7 +1037,7 @@ static int __init read_factory_bbt(struct mtd_info *mtd)
> * operation after device power-up. The above read ensures it never is.
> * Ugly, I know.
> */
> - if (nand->bbt == NULL) /* no memory-based bbt */
> + if (nand->nand_bbt == NULL) /* no memory-based bbt */

Hm, can we avoid direct references to the ->nand_bbt field by either
providing an accessor (nand_get_bbt()), or providing wrappers around
the nand_chip device (nand_has_bbt(nand), nand_markbad_factory(nand,
ofs), ...)?
In my rather limited experience, doing that is more future-proof.

--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


\
 
 \ /
  Last update: 2016-01-06 15:01    [W:0.967 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site