summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-cadence-quadspi.c
diff options
context:
space:
mode:
authorYoshitaka Ikeda <ikeda@nskint.co.jp>2021-07-16 16:33:12 +0200
committerMark Brown <broonie@kernel.org>2021-07-16 17:58:28 +0200
commit0ccfd1ba84a4503b509250941af149e9ebd605ca (patch)
treea8453569922abe88fb9aa660d607109603630cae /drivers/spi/spi-cadence-quadspi.c
parentspi: spi-cadence-quadspi: Fix division by zero warning (diff)
downloadlinux-0ccfd1ba84a4503b509250941af149e9ebd605ca.tar.xz
linux-0ccfd1ba84a4503b509250941af149e9ebd605ca.zip
spi: spi-cadence-quadspi: Revert "Fix division by zero warning"
Revert to change to a better code. This reverts commit 55cef88bbf12f3bfbe5c2379a8868a034707e755. Signed-off-by: Yoshitaka Ikeda <ikeda@nskint.co.jp> Link: https://lore.kernel.org/r/bd30bdb4-07c4-f713-5648-01c898d51f1b@nskint.co.jp Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-cadence-quadspi.c')
-rw-r--r--drivers/spi/spi-cadence-quadspi.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 13d1f0ce618e..7a00346ff9b9 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -307,13 +307,11 @@ static unsigned int cqspi_calc_rdreg(struct cqspi_flash_pdata *f_pdata)
static unsigned int cqspi_calc_dummy(const struct spi_mem_op *op, bool dtr)
{
- unsigned int dummy_clk = 0;
+ unsigned int dummy_clk;
- if (op->dummy.buswidth && op->dummy.nbytes) {
- dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
- if (dtr)
- dummy_clk /= 2;
- }
+ dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
+ if (dtr)
+ dummy_clk /= 2;
return dummy_clk;
}