[PATCH V2] Add support for flag status register on Micron chips.

Marek Vasut marex at denx.de
Sun Apr 13 10:18:45 PDT 2014


On Friday, April 11, 2014 at 05:03:13 PM, grmoore at altera.com wrote:
[...]
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index ad19139..4cddbc8 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -39,6 +39,7 @@
>  #define	OPCODE_WREN		0x06	/* Write enable */
>  #define	OPCODE_RDSR		0x05	/* Read status register */
>  #define	OPCODE_WRSR		0x01	/* Write status register 1 byte 
*/
> +#define	OPCODE_RDFSR		0x70  /* read flag status register */

I know this is not your fault, but can you please indent this properly with 
tabs?

>  #define	OPCODE_NORM_READ	0x03	/* Read data bytes (low 
frequency) */
>  #define	OPCODE_FAST_READ	0x0b	/* Read data bytes (high 
frequency) */
>  #define	OPCODE_QUAD_READ        0x6b    /* Read data bytes */

And fix this one in a separate patch to use tabs as well please ?

[...]

> @@ -790,7 +847,7 @@ static int m25p80_unlock(struct mtd_info *mtd, loff_t
> ofs, uint64_t len)
> 
>  	mutex_lock(&flash->lock);
>  	/* Wait until finished previous command */
> -	if (wait_till_ready(flash)) {
> +	if (flash->wait_till_ready(flash)) {

I wonder, can't wait_till_ready() be made a wrapper that will check the USE_FSR 
flag and call correct wait-function ? This would avoid adding a new member to 
*flash and also would avoid so many changes throughout the code. What do you 
think?
[...]
Best regards,
Marek Vasut



More information about the linux-mtd mailing list