public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] SPI: fixup typo in omap2_spi.c
@ 2016-11-04 14:53 郑 祎
  2016-11-11 11:50 ` Jagan Teki
  0 siblings, 1 reply; 2+ messages in thread
From: 郑 祎 @ 2016-11-04 14:53 UTC (permalink / raw)
  To: u-boot

  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(-)

diff --git a/drivers/spi/omap3_spi.c b/drivers/spi/omap3_spi.c
index 60e9d6e..2380a0e 100644
--- a/drivers/spi/omap3_spi.c
+++ b/drivers/spi/omap3_spi.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-11 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 14:53 [U-Boot] [PATCH] SPI: fixup typo in omap2_spi.c 郑 祎
2016-11-11 11:50 ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox