Skip to content

Commit

Permalink
mtd: spi-nor: Retain nor->addr_width at 4BAIT parse
Browse files Browse the repository at this point in the history
In 4BAIT parse, keep nor->addr_width because it may be used as
current address mode in SMPT parse later on.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
  • Loading branch information
Kuwano-san authored and ambarus committed Apr 21, 2022
1 parent e3430d5 commit 61d73de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/mtd/spi-nor/core.c
Expand Up @@ -2272,6 +2272,9 @@ static int spi_nor_default_setup(struct spi_nor *nor,

static int spi_nor_set_addr_width(struct spi_nor *nor)
{
if (nor->flags & SNOR_F_HAS_4BAIT)
nor->addr_width = 4;

if (nor->addr_width) {
/* already configured from SFDP */
} else if (nor->read_proto == SNOR_PROTO_8_8_8_DTR) {
Expand Down
1 change: 0 additions & 1 deletion drivers/mtd/spi-nor/sfdp.c
Expand Up @@ -1098,7 +1098,6 @@ static int spi_nor_parse_4bait(struct spi_nor *nor,
* Spansion memory. However this quirk is no longer needed with new
* SFDP compliant memories.
*/
nor->addr_width = 4;
nor->flags |= SNOR_F_4B_OPCODES | SNOR_F_HAS_4BAIT;

/* fall through */
Expand Down

0 comments on commit 61d73de

Please sign in to comment.