spi: Fixed division by zero warning
authorYoshitaka Ikeda <ikeda@nskint.co.jp>
Wed, 8 Sep 2021 05:29:12 +0000 (05:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:24 +0000 (19:16 +0100)
commit3409f88809a685fbf9ff6a3cd5599110370e647d
tree02fc90531d98c013ab51ae3e58e6beca8fa95f32
parentbc79831b426b12d8e7b0b8e4c5226171085e4a73
spi: Fixed division by zero warning

[ Upstream commit 09134c5322df9f105d9ed324051872d5d0e162aa ]

The reason for dividing by zero is because the dummy bus width is zero,
but if the dummy n bytes is zero, it indicates that there is no data transfer,
so there is no need for calculation.

Fixes: 7512eaf54190 ("spi: cadence-quadspi: Fix dummy cycle calculation when buswidth > 1")
Signed-off-by: Yoshitaka Ikeda <ikeda@nskint.co.jp>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/OSZPR01MB70049C8F56ED8902852DF97B8BD49@OSZPR01MB7004.jpnprd01.prod.outlook.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/atmel-quadspi.c
drivers/spi/spi-bcm-qspi.c
drivers/spi/spi-mtk-nor.c
drivers/spi/spi-stm32-qspi.c