summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2024-08-31 22:31:45 +0200
committerMarek Vasut <marek.vasut+renesas@mailbox.org>2024-09-09 01:10:33 +0200
commit3fba388e611e27e663c7cb4c1d1483e8909bdbc0 (patch)
treecac6bad3adc685fbf89466cd71dbbd0ea7ec2774
parent1cc7c7e119a31c64cf64d887374c95b58ffe9993 (diff)
downloadu-boot-3fba388e611e27e663c7cb4c1d1483e8909bdbc0.tar.gz
u-boot-3fba388e611e27e663c7cb4c1d1483e8909bdbc0.tar.bz2
u-boot-3fba388e611e27e663c7cb4c1d1483e8909bdbc0.zip
mtd: spi: renesas: Write DRDMCR register once
Instead of writing DRDMCR with 0 first and then overwriting DRDMCR again in case any dummy bytes have to be sent out, write DRDMCR in every case with the amount of dummy bytes that have to be sent out. In case no dummy bytes have to be sent out, the value written into DRDMCR is zero, so no dummy bytes are sent out. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
-rw-r--r--drivers/spi/renesas_rpc_spi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/spi/renesas_rpc_spi.c b/drivers/spi/renesas_rpc_spi.c
index 749c686a6c..a2ac5525b9 100644
--- a/drivers/spi/renesas_rpc_spi.c
+++ b/drivers/spi/renesas_rpc_spi.c
@@ -289,12 +289,10 @@ static int rpc_spi_mem_exec_op(struct spi_slave *spi,
smenr |= RPC_DRENR_ADE(0);
}
- writel(0, priv->regs + RPC_DRDMCR);
- if (op->dummy.nbytes) {
- writel(8 * op->dummy.nbytes - 1, priv->regs + RPC_DRDMCR);
+ if (op->dummy.nbytes)
smenr |= RPC_DRENR_DME;
- }
+ writel(8 * op->dummy.nbytes - 1, priv->regs + RPC_DRDMCR);
writel(0, priv->regs + RPC_DROPR);
writel(smenr, priv->regs + RPC_DRENR);