Skip to content

Commit 0ccfd1b

Browse files
yoikedabroonie
authored andcommitted
spi: spi-cadence-quadspi: Revert "Fix division by zero warning"
Revert to change to a better code. This reverts commit 55cef88. Signed-off-by: Yoshitaka Ikeda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 55cef88 commit 0ccfd1b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,11 @@ static unsigned int cqspi_calc_rdreg(struct cqspi_flash_pdata *f_pdata)
307307

308308
static unsigned int cqspi_calc_dummy(const struct spi_mem_op *op, bool dtr)
309309
{
310-
unsigned int dummy_clk = 0;
310+
unsigned int dummy_clk;
311311

312-
if (op->dummy.buswidth && op->dummy.nbytes) {
313-
dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
314-
if (dtr)
315-
dummy_clk /= 2;
316-
}
312+
dummy_clk = op->dummy.nbytes * (8 / op->dummy.buswidth);
313+
if (dtr)
314+
dummy_clk /= 2;
317315

318316
return dummy_clk;
319317
}

0 commit comments

Comments
 (0)