[PATCH v2 8/8] MTD: xway: use global NAND_CMD_RESET define

Boris Brezillon boris.brezillon at free-electrons.com
Sun Jun 19 06:06:53 PDT 2016


On Sat, 18 Jun 2016 21:14:12 +0200
Hauke Mehrtens <hauke at hauke-m.de> wrote:

> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
> ---
>  drivers/mtd/nand/xway_nand.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/xway_nand.c b/drivers/mtd/nand/xway_nand.c
> index b3badf9..7244bb8 100644
> --- a/drivers/mtd/nand/xway_nand.c
> +++ b/drivers/mtd/nand/xway_nand.c
> @@ -34,7 +34,6 @@
>  #define NAND_CMD_SE		(1 << 5)
>  #define NAND_CMD_WP		(1 << 6)
>  #define NAND_CMD_PRE		(1 << 7)
> -#define NAND_WRITE_CMD_RESET	0xff
>  #define NAND_WRITE_CMD		(NAND_CMD_CS | NAND_CMD_CLE)
>  #define NAND_WRITE_ADDR		(NAND_CMD_CS | NAND_CMD_ALE)
>  #define NAND_WRITE_DATA		(NAND_CMD_CS)
> @@ -99,7 +98,7 @@ static void xway_reset_chip(struct nand_chip *chip)
>  	timeout = jiffies + msecs_to_jiffies(20);
>  
>  	spin_lock_irqsave(&ebu_lock, flags);
> -	writeb(NAND_WRITE_CMD_RESET, (void __iomem *) nandaddr);
> +	writeb(NAND_CMD_RESET, (void __iomem *) nandaddr);

That's a good intention, but as I said, I think we can get rid of the
whole function and use ->cmdfunc(RESET) instead.

>  	do {
>  		if ((ltq_ebu_r32(EBU_NAND_WAIT) & NAND_WAIT_WR_C) == 0)
>  			break;




More information about the linux-mtd mailing list