Commit 2130be57 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by Mark Brown

spi: spi-sun6i: sun6i_spi_transfer_one(): remove not needed masking of transfer length

In sun6i_spi_transfer_one() the driver ensures that the length of the transfer
is smaller or equal to SUN6I_MAX_XFER_SIZE. This means the masking of the
length to SUN6I_MAX_XFER_SIZE can be skipped when writing the transfer length
into the registers.

This patch removes the useless masking of the transfer length to
SUN6I_MAX_XFER_SIZE.
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20200706143443.9855-5-mkl@pengutronix.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b6d55273
...@@ -73,13 +73,10 @@ ...@@ -73,13 +73,10 @@
#define SUN6I_MAX_XFER_SIZE 0xffffff #define SUN6I_MAX_XFER_SIZE 0xffffff
#define SUN6I_BURST_CNT_REG 0x30 #define SUN6I_BURST_CNT_REG 0x30
#define SUN6I_BURST_CNT(cnt) ((cnt) & SUN6I_MAX_XFER_SIZE)
#define SUN6I_XMIT_CNT_REG 0x34 #define SUN6I_XMIT_CNT_REG 0x34
#define SUN6I_XMIT_CNT(cnt) ((cnt) & SUN6I_MAX_XFER_SIZE)
#define SUN6I_BURST_CTL_CNT_REG 0x38 #define SUN6I_BURST_CTL_CNT_REG 0x38
#define SUN6I_BURST_CTL_CNT_STC(cnt) ((cnt) & SUN6I_MAX_XFER_SIZE)
#define SUN6I_TXDATA_REG 0x200 #define SUN6I_TXDATA_REG 0x200
#define SUN6I_RXDATA_REG 0x300 #define SUN6I_RXDATA_REG 0x300
...@@ -305,10 +302,9 @@ static int sun6i_spi_transfer_one(struct spi_master *master, ...@@ -305,10 +302,9 @@ static int sun6i_spi_transfer_one(struct spi_master *master,
tx_len = tfr->len; tx_len = tfr->len;
/* Setup the counters */ /* Setup the counters */
sun6i_spi_write(sspi, SUN6I_BURST_CNT_REG, SUN6I_BURST_CNT(tfr->len)); sun6i_spi_write(sspi, SUN6I_BURST_CNT_REG, tfr->len);
sun6i_spi_write(sspi, SUN6I_XMIT_CNT_REG, SUN6I_XMIT_CNT(tx_len)); sun6i_spi_write(sspi, SUN6I_XMIT_CNT_REG, tx_len);
sun6i_spi_write(sspi, SUN6I_BURST_CTL_CNT_REG, sun6i_spi_write(sspi, SUN6I_BURST_CTL_CNT_REG, tx_len);
SUN6I_BURST_CTL_CNT_STC(tx_len));
/* Fill the TX FIFO */ /* Fill the TX FIFO */
sun6i_spi_fill_fifo(sspi, sspi->fifo_depth); sun6i_spi_fill_fifo(sspi, sspi->fifo_depth);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment