diff options
author | Yoshitaka Ikeda <ikeda@nskint.co.jp> | 2021-09-08 05:29:12 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-09-20 13:38:18 +0100 |
commit | 09134c5322df9f105d9ed324051872d5d0e162aa (patch) | |
tree | 831d45ae843c7045bc23695ed2238fe784e79264 /drivers/spi/atmel-quadspi.c | |
parent | 3323129a6db96b6878a260601b30651ca40caa54 (diff) | |
download | linux-stable-09134c5322df9f105d9ed324051872d5d0e162aa.tar.gz linux-stable-09134c5322df9f105d9ed324051872d5d0e162aa.tar.bz2 linux-stable-09134c5322df9f105d9ed324051872d5d0e162aa.zip |
spi: Fixed division by zero warning
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>
Diffstat (limited to 'drivers/spi/atmel-quadspi.c')
-rw-r--r-- | drivers/spi/atmel-quadspi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 95d4fa32c299..92d9610df1fd 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -310,7 +310,7 @@ static int atmel_qspi_set_cfg(struct atmel_qspi *aq, return mode; ifr |= atmel_qspi_modes[mode].config; - if (op->dummy.buswidth && op->dummy.nbytes) + if (op->dummy.nbytes) dummy_cycles = op->dummy.nbytes * 8 / op->dummy.buswidth; /* |