Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1afd9989 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mark Brown
Browse files

spi: core: Improve tx/rx_nbits check comments



  - Rephrase the comments about tx/rx_nbits validity checks,
  - Remove the stale comment about SPI_3WIRE (the code it refers to was
    removed in commit 368ca4e0 ("spi:
    Eliminate 3WIRE spi_transfer check")).

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 269ccca8
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -1660,9 +1660,8 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
		if (xfer->rx_buf && !xfer->rx_nbits)
		if (xfer->rx_buf && !xfer->rx_nbits)
			xfer->rx_nbits = SPI_NBITS_SINGLE;
			xfer->rx_nbits = SPI_NBITS_SINGLE;
		/* check transfer tx/rx_nbits:
		/* check transfer tx/rx_nbits:
		 * 1. keep the value is not out of single, dual and quad
		 * 1. check the value matches one of single, dual and quad
		 * 2. keep tx/rx_nbits is contained by mode in spi_device
		 * 2. check tx/rx_nbits match the mode in spi_device
		 * 3. if SPI_3WIRE, tx/rx_nbits should be in single
		 */
		 */
		if (xfer->tx_buf) {
		if (xfer->tx_buf) {
			if (xfer->tx_nbits != SPI_NBITS_SINGLE &&
			if (xfer->tx_nbits != SPI_NBITS_SINGLE &&