Skip to content

Commit

Permalink
spi: spi-cadence-quadspi: Revert "Fix division by zero warning"
Browse files Browse the repository at this point in the history
commit 0ccfd1b upstream.

Revert to change to a better code.

This reverts commit 55cef88.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
yoikeda authored and gregkh committed Jul 28, 2021
1 parent bc93e99 commit da510a3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/spi/spi-cadence-quadspi.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit da510a3

Please sign in to comment.