On the transmission loop, check for remaining bytes at the loop
condition.
This way we can handle transmissions of 0 bytes and clean the code.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
xspi->remaining_bytes = t->len;
reinit_completion(&xspi->done);
- for (;;) {
+ while (xspi->remaining_bytes) {
u16 cr;
int n_words;
/* Read out all the data from the Rx FIFO */
while (n_words--)
xspi->rx_fn(xspi);
-
- /* See if there is more data to send */
- if (xspi->remaining_bytes <= 0)
- break;
}
return t->len - xspi->remaining_bytes;