Unverified Commit ede090f5 authored by Xu Yilun's avatar Xu Yilun Committed by Mark Brown
Browse files

spi: altera: fix return value for altera_spi_txrx()



This patch fixes the return value for altera_spi_txrx. It should return
1 for interrupt transfer mode, and return 0 for polling transfer mode.

The altera_spi_txrx() implements the spi_controller.transfer_one
callback. According to the spi-summary.rst, the transfer_one should
return 0 when transfer is finished, return 1 when transfer is still in
progress.

Signed-off-by: default avatarXu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/1609219662-27057-2-git-send-email-yilun.xu@intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8db90aa3
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -189,7 +189,10 @@ static int altera_spi_txrx(struct spi_master *master,

		/* send the first byte */
		altera_spi_tx_word(hw);
	} else {

		return 1;
	}

	while (hw->count < hw->len) {
		altera_spi_tx_word(hw);

@@ -204,9 +207,8 @@ static int altera_spi_txrx(struct spi_master *master,
		altera_spi_rx_word(hw);
	}
	spi_finalize_current_transfer(master);
	}

	return t->len;
	return 0;
}

static irqreturn_t altera_spi_irq(int irq, void *dev)