[PATCH v2 13/35] mtd: spi-nor: sst: Use manufacturer late_init() to set _write()

Pratyush Yadav p.yadav at ti.com
Mon Aug 16 12:20:26 PDT 2021


On 27/07/21 07:52AM, Tudor Ambarus wrote:
> 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: Pratyush Yadav <p.yadav at ti.com>

> ---
>  drivers/mtd/spi-nor/sst.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c
> index 29d100febdbf..eeb10766b70e 100644
> --- a/drivers/mtd/spi-nor/sst.c
> +++ b/drivers/mtd/spi-nor/sst.c
> @@ -173,19 +173,15 @@ 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)
>  		nor->mtd._write = sst_write;
>  }
>  
> -static const struct spi_nor_fixups sst_fixups = {
> -	.post_sfdp = sst_post_sfdp_fixups,
> -};
> -
>  const struct spi_nor_manufacturer spi_nor_sst = {
>  	.name = "sst",
>  	.parts = sst_parts,
>  	.nparts = ARRAY_SIZE(sst_parts),
> -	.fixups = &sst_fixups,
> +	.late_init = sst_late_init,
>  };
> -- 
> 2.25.1
> 

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.



More information about the linux-arm-kernel mailing list