diff mbox series

[3/4] mtd: spi-nor: Remove SPI_NOR_SKIP_SFDP flag

Message ID b87c372691e30ea19d71858cfc2c06b96337b1e7.1722917617.git.Takahiro.Kuwano@infineon.com
State New
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series mtd: spi-nor: add generic flash driver | expand

Commit Message

Takahiro Kuwano Aug. 8, 2024, 6 a.m. UTC
From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>

This flag is not used in INFO table so checking info->flags has no
effect.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
---
 drivers/mtd/spi/sf_internal.h  | 9 ++++-----
 drivers/mtd/spi/spi-nor-core.c | 5 ++---
 2 files changed, 6 insertions(+), 8 deletions(-)

Comments

Tudor Ambarus Sept. 10, 2024, 7:38 a.m. UTC | #1
On 08.08.2024 09:00, tkuw584924@gmail.com wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> 
> This flag is not used in INFO table so checking info->flags has no
> effect.
> 
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>

this patch can be send on its own I guess. Maybe Jagan can take it now:

Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

> ---
>  drivers/mtd/spi/sf_internal.h  | 9 ++++-----
>  drivers/mtd/spi/spi-nor-core.c | 5 ++---
>  2 files changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> index d3ef69ec74..57608750c9 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -64,11 +64,10 @@ struct flash_info {
>  					 * to support memory size above 128Mib.
>  					 */
>  #define NO_CHIP_ERASE		BIT(12) /* Chip does not support chip erase */
> -#define SPI_NOR_SKIP_SFDP	BIT(13)	/* Skip parsing of SFDP tables */
> -#define USE_CLSR		BIT(14)	/* use CLSR command */
> -#define SPI_NOR_HAS_SST26LOCK	BIT(15)	/* Flash supports lock/unlock via BPR */
> -#define SPI_NOR_OCTAL_READ	BIT(16)	/* Flash supports Octal Read */
> -#define SPI_NOR_OCTAL_DTR_READ	BIT(17)	/* Flash supports Octal DTR Read */
> +#define USE_CLSR		BIT(13)	/* use CLSR command */
> +#define SPI_NOR_HAS_SST26LOCK	BIT(14)	/* Flash supports lock/unlock via BPR */
> +#define SPI_NOR_OCTAL_READ	BIT(15)	/* Flash supports Octal Read */
> +#define SPI_NOR_OCTAL_DTR_READ	BIT(16)	/* Flash supports Octal DTR Read */
>  };
>  
>  extern const struct flash_info spi_nor_ids[];
> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
> index 54fd2869a2..feafc48a49 100644
> --- a/drivers/mtd/spi/spi-nor-core.c
> +++ b/drivers/mtd/spi/spi-nor-core.c
> @@ -3013,9 +3013,8 @@ static int spi_nor_init_params(struct spi_nor *nor,
>  	/* Override the parameters with data read from SFDP tables. */
>  	nor->addr_width = 0;
>  	nor->mtd.erasesize = 0;
> -	if ((info->flags & (SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
> -	     SPI_NOR_OCTAL_DTR_READ)) &&
> -	    !(info->flags & SPI_NOR_SKIP_SFDP)) {
> +	if (info->flags & (SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
> +	    SPI_NOR_OCTAL_DTR_READ)) {
>  		struct spi_nor_flash_parameter sfdp_params;
>  
>  		memcpy(&sfdp_params, params, sizeof(sfdp_params));
diff mbox series

Patch

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index d3ef69ec74..57608750c9 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -64,11 +64,10 @@  struct flash_info {
 					 * to support memory size above 128Mib.
 					 */
 #define NO_CHIP_ERASE		BIT(12) /* Chip does not support chip erase */
-#define SPI_NOR_SKIP_SFDP	BIT(13)	/* Skip parsing of SFDP tables */
-#define USE_CLSR		BIT(14)	/* use CLSR command */
-#define SPI_NOR_HAS_SST26LOCK	BIT(15)	/* Flash supports lock/unlock via BPR */
-#define SPI_NOR_OCTAL_READ	BIT(16)	/* Flash supports Octal Read */
-#define SPI_NOR_OCTAL_DTR_READ	BIT(17)	/* Flash supports Octal DTR Read */
+#define USE_CLSR		BIT(13)	/* use CLSR command */
+#define SPI_NOR_HAS_SST26LOCK	BIT(14)	/* Flash supports lock/unlock via BPR */
+#define SPI_NOR_OCTAL_READ	BIT(15)	/* Flash supports Octal Read */
+#define SPI_NOR_OCTAL_DTR_READ	BIT(16)	/* Flash supports Octal DTR Read */
 };
 
 extern const struct flash_info spi_nor_ids[];
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index 54fd2869a2..feafc48a49 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -3013,9 +3013,8 @@  static int spi_nor_init_params(struct spi_nor *nor,
 	/* Override the parameters with data read from SFDP tables. */
 	nor->addr_width = 0;
 	nor->mtd.erasesize = 0;
-	if ((info->flags & (SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
-	     SPI_NOR_OCTAL_DTR_READ)) &&
-	    !(info->flags & SPI_NOR_SKIP_SFDP)) {
+	if (info->flags & (SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
+	    SPI_NOR_OCTAL_DTR_READ)) {
 		struct spi_nor_flash_parameter sfdp_params;
 
 		memcpy(&sfdp_params, params, sizeof(sfdp_params));