[PATCH 1/3] mtd: spi-nor: extend no_sfdp_flags to use u16

Tudor.Ambarus at microchip.com Tudor.Ambarus at microchip.com
Mon Jul 18 09:58:09 PDT 2022


On 7/12/22 19:38, Sudip Mukherjee wrote:
> [You don't often get email from sudip.mukherjee at sifive.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Currently no_sfdp_flags is u8 and all the bits have been used. Extend
> it to use u16 so that we can add more support.
> 
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee at sifive.com>
> ---
>  drivers/mtd/spi-nor/core.c | 2 +-
>  drivers/mtd/spi-nor/core.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index ce5d69317d46c..e5f7691c5bd40 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -2335,7 +2335,7 @@ static void spi_nor_no_sfdp_init_params(struct spi_nor *nor)
>  {
>         struct spi_nor_flash_parameter *params = nor->params;
>         struct spi_nor_erase_map *map = &params->erase_map;
> -       const u8 no_sfdp_flags = nor->info->no_sfdp_flags;
> +       const u16 no_sfdp_flags = nor->info->no_sfdp_flags;
>         u8 i, erase_mask;
> 
>         if (no_sfdp_flags & SPI_NOR_DUAL_READ) {
> diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
> index 61886868cd022..58fbedc94080f 100644
> --- a/drivers/mtd/spi-nor/core.h
> +++ b/drivers/mtd/spi-nor/core.h
> @@ -501,7 +501,7 @@ struct flash_info {
>  #define NO_CHIP_ERASE                  BIT(7)
>  #define SPI_NOR_NO_FR                  BIT(8)
> 
> -       u8 no_sfdp_flags;
> +       u16 no_sfdp_flags;

>  #define SPI_NOR_SKIP_SFDP              BIT(0)
>  #define SECT_4K                                BIT(1)
>  #define SPI_NOR_DUAL_READ              BIT(3)
> --
> 2.30.2
> 

you can extend this when introducing a new flag, if needed.
No need for a dedicated patch just for this.


More information about the linux-mtd mailing list