[PATCH v3 10/25] mtd: spi-nor: sst: Use manufacturer late_init() to set _write()

Michael Walle michael at walle.cc
Tue Nov 9 01:47:28 PST 2021


Am 2021-10-29 19:26, schrieb Tudor Ambarus:
> Setting the correct nor->mtd._write in a fixup hook was misleading,
> since this is not a fixup, just a specific setting for SST, that 
> differs
> from the SPI NOR core default init.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus at microchip.com>

Reviewed-by: Michael Walle <michael at walle.cc>

Just a comment below.

> ---
>  drivers/mtd/spi-nor/sst.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c
> index 660aabde477a..3593aae0920f 100644
> --- a/drivers/mtd/spi-nor/sst.c
> +++ b/drivers/mtd/spi-nor/sst.c
> @@ -177,14 +177,14 @@ static int sst_write(struct mtd_info *mtd,
> loff_t to, size_t len,
>  	return ret;
>  }
> 
> -static void sst_post_sfdp_fixups(struct spi_nor *nor)
> +static void sst_late_init(struct spi_nor *nor)
>  {
>  	if (nor->info->flags & SST_WRITE)

SST_WRITE is only used during to set this. Shouldn't this be
a fixup per flash so we don't need that flag.

>  		nor->mtd._write = sst_write;
>  }
> 
>  static const struct spi_nor_fixups sst_fixups = {
> -	.post_sfdp = sst_post_sfdp_fixups,
> +	.late_init = sst_late_init,
>  };
> 
>  const struct spi_nor_manufacturer spi_nor_sst = {

-michael



More information about the linux-mtd mailing list