diff mbox series

mtd: spi-nor-core: Fix index value for SCCR dwords

Message ID 20220912052540.4608-1-Takahiro.Kuwano@infineon.com
State Accepted
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series mtd: spi-nor-core: Fix index value for SCCR dwords | expand

Commit Message

Takahiro Kuwano Sept. 12, 2022, 5:25 a.m. UTC
From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>

Array index for SCCR 22th DWORD should be 21.

Fixes: bebdc237507c ("mtd: spi-nor: Parse SFDP SCCR Map")
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
---
 drivers/mtd/spi/spi-nor-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jagan Teki Oct. 23, 2022, 5:30 a.m. UTC | #1
On Mon, Sep 12, 2022 at 10:56 AM <tkuw584924@gmail.com> wrote:
>
> From: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
>
> Array index for SCCR 22th DWORD should be 21.
>
> Fixes: bebdc237507c ("mtd: spi-nor: Parse SFDP SCCR Map")
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
> ---

Applied to u-boot-spi/master
diff mbox series

Patch

diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index e3c86e080a1d..65dc69a4be9a 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -2493,7 +2493,7 @@  static int spi_nor_parse_sccr(struct spi_nor *nor,
 	for (i = 0; i < sccr_header->length; i++)
 		table[i] = le32_to_cpu(table[i]);
 
-	if (FIELD_GET(SCCR_DWORD22_OCTAL_DTR_EN_VOLATILE, table[22]))
+	if (FIELD_GET(SCCR_DWORD22_OCTAL_DTR_EN_VOLATILE, table[21]))
 		nor->flags |= SNOR_F_IO_MODE_EN_VOLATILE;
 
 out: