Skip to content

Commit 2ec8b01

Browse files
wkenningtonbroonie
authored andcommitted
spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
We don't want to use the value of ilog2(0) as dummy.buswidth is 0 when dummy.nbytes is 0. Since we have no dummy bytes, we don't need to configure the dummy byte bits per clock register value anyway. Signed-off-by: "William A. Kennington III" <william@wkennington.com> Link: https://lore.kernel.org/r/20230922182812.2728066-1-william@wkennington.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 1a8196a commit 2ec8b01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/spi/spi-npcm-fiu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ static int npcm_fiu_uma_read(struct spi_mem *mem,
353353
uma_cfg |= ilog2(op->cmd.buswidth);
354354
uma_cfg |= ilog2(op->addr.buswidth)
355355
<< NPCM_FIU_UMA_CFG_ADBPCK_SHIFT;
356-
uma_cfg |= ilog2(op->dummy.buswidth)
357-
<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
356+
if (op->dummy.nbytes)
357+
uma_cfg |= ilog2(op->dummy.buswidth)
358+
<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
358359
uma_cfg |= ilog2(op->data.buswidth)
359360
<< NPCM_FIU_UMA_CFG_RDBPCK_SHIFT;
360361
uma_cfg |= op->dummy.nbytes << NPCM_FIU_UMA_CFG_DBSIZ_SHIFT;

0 commit comments

Comments
 (0)