]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: spi: renesas: Write DRDMCR register once
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 31 Aug 2024 20:31:45 +0000 (22:31 +0200)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 8 Sep 2024 23:10:33 +0000 (01:10 +0200)
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>
drivers/spi/renesas_rpc_spi.c

index 749c686a6c470834682958356e9dcf84d76665b9..a2ac5525b90dc3883ea5a51ab61db1d7094f6c76 100644 (file)
@@ -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);