[PATCH v2] mtd: fsl-quadspi: Fix module unbound

Brian Norris computersforpeace at gmail.com
Wed Jan 7 00:45:10 PST 2015


On Wed, Jan 07, 2015 at 01:05:27AM -0200, Fabio Estevam wrote:
> diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
> index 39763b9..8cdd73f 100644
> --- a/drivers/mtd/spi-nor/fsl-quadspi.c
> +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
...
> @@ -661,7 +661,7 @@ MODULE_DEVICE_TABLE(of, fsl_qspi_dt_ids);
>  
>  static void fsl_qspi_set_base_addr(struct fsl_qspi *q, struct spi_nor *nor)
>  {
> -	q->chip_base_addr = q->nor_size * (nor - q->nor);
> +	q->chip_base_addr += (q->nor_size * 2);

This doesn't look right to me...

Recall there is one struct fsl_qspi that maps to several struct spi_nor.
This function gets called several times, so it'll be incrementing this
every time. It probably just happens to work once for you.

>  }
>  
>  static int fsl_qspi_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)

Brian



More information about the linux-mtd mailing list