[PATCH v2 10/35] mtd: spi-nor: sst: Use flash late_init() for locking

Pratyush Yadav p.yadav at ti.com
Mon Aug 16 12:09:30 PDT 2021


On 27/07/21 07:51AM, Tudor Ambarus wrote:
> Locking ops are not discoverable via SFDP, use late_init() call.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus at microchip.com>

Reviewed-by: Pratyush Yadav <p.yadav at ti.com>

One question though. Have you tested these flashes (this one and the 
ones in the previous patch) to make sure you are not causing any 
regressions? While I don't see anything wrong with the patches, it would 
be good to have some test reports.

> ---
>  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 980f4c09c91d..29d100febdbf 100644
> --- a/drivers/mtd/spi-nor/sst.c
> +++ b/drivers/mtd/spi-nor/sst.c
> @@ -46,15 +46,11 @@ static const struct spi_nor_locking_ops sst26vf_locking_ops = {
>  	.is_locked = sst26vf_is_locked,
>  };
>  
> -static void sst26vf_default_init(struct spi_nor *nor)
> +static void sst26vf_late_init(struct spi_nor *nor)
>  {
>  	nor->params->locking_ops = &sst26vf_locking_ops;
>  }
>  
> -static const struct spi_nor_fixups sst26vf_fixups = {
> -	.default_init = sst26vf_default_init,
> -};
> -
>  static const struct flash_info sst_parts[] = {
>  	/* SST -- large erase sizes are "overlays", "sectors" are 4K */
>  	{ "sst25vf040b", INFO(0xbf258d, 0, 64 * 1024,  8,
> @@ -88,7 +84,7 @@ static const struct flash_info sst_parts[] = {
>  	{ "sst26vf064b", INFO(0xbf2643, 0, 64 * 1024, 128,
>  			      SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
>  			      SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE)
> -		.fixups = &sst26vf_fixups },
> +		.late_init = sst26vf_late_init},
>  };
>  
>  static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
> -- 
> 2.25.1
> 

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.



More information about the linux-mtd mailing list