Skip to contentSkip to conversation

SPI: fixup typo in omap2_spi.c

PATCH New 郑 祎 2 participants 2 messages Nov 4, 2016 – Nov 11, 2016 SPI

lore
Share & tools
lore

郑 祎

author
#0 lore raw

PATCH 1/1 SPI: fixup typo in omap2_spi.c

regs->channel[] is an array of registers in SoC. It is indexed by CS# Fixup the typo which will cause the index error when accessing the hardware.

In the all other code, regs->channel[] is indexed by 'priv->cs', so I think it is reasonable to fix that wrongly register accessing.

---
 drivers/spi/omap3_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/omap3_spi.c +1 -1
index 60e9d6e..2380a0e 100644
@@ -416,7 +416,7 @@ static void _omap3_spi_set_wordlen(struct omap3_spi_priv *priv)
 	unsigned int confr;
 
 	/* McSPI individual channel configuration */
-	confr = readl(&priv->regs->channel[priv->wordlen].chconf);
+	confr = readl(&priv->regs->channel[priv->cs].chconf);
 
 	/* wordlength */
 	confr &= ~OMAP3_MCSPI_CHCONF_WL_MASK;
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/1 SPI: fixup typo in omap2_spi.c

This patch missing name in English and Signed-Off-by. please fix.

Quoted 26 lines · ? ?

regs->channel[] is an array of registers in SoC. It is indexed by CS# Fixup the typo which will cause the index error when accessing the hardware.

In the all other code, regs->channel[] is indexed by 'priv->cs', so I think it is reasonable to fix that wrongly register accessing.

---
 drivers/spi/omap3_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/omap3_spi.c +1 -2
index 60e9d6e..2380a0e 100644
@@ -416,7 +416,7 @@ static void _omap3_spi_set_wordlen(struct omap3_spi_priv *priv)
        unsigned int confr;
 
        /* McSPI individual channel configuration */
-       confr = readl(&priv->regs->channel[priv->wordlen].chconf);
+       confr = readl(&priv->regs->channel[priv->cs].chconf);
 
        /* wordlength */
        confr &= ~OMAP3_MCSPI_CHCONF_WL_MASK;
--

2.10.2

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.