]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
spi: Fixed division by zero warning
authorYoshitaka Ikeda <ikeda@nskint.co.jp>
Wed, 8 Sep 2021 05:29:12 +0000 (05:29 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 7 Dec 2021 06:32:52 +0000 (07:32 +0100)
commitfe1dc4661c74ae5437fa973bf2637a79ab71d5a3
tree1f4577260461e24ed52ce6011e7f53aeab25a564
parente742b838d9615f225064199a7bbdd8cd79b92e2a
spi: Fixed division by zero warning

BugLink: https://bugs.launchpad.net/bugs/1951822
[ 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>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/spi/atmel-quadspi.c
drivers/spi/spi-bcm-qspi.c
drivers/spi/spi-mtk-nor.c
drivers/spi/spi-stm32-qspi.c