diff mbox

spi: tegra114: Use list_is_last() instead of open-coded

Message ID 1389766024.7410.4.camel@phoenix (mailing list archive)
State Accepted
Commit 971e9084beb50c0b244ff95ef2d888f7d158b8a8
Headers show

Commit Message

Axel Lin Jan. 15, 2014, 6:07 a.m. UTC
For better readability, and then we can remove the comment for last transfer.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi-tegra114.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mark Brown Jan. 27, 2014, 8:29 p.m. UTC | #1
On Wed, Jan 15, 2014 at 02:07:04PM +0800, Axel Lin wrote:
> For better readability, and then we can remove the comment for last transfer.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 413c718..ead3ae8 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -853,8 +853,8 @@  complete_xfer:
 					SPI_COMMAND1);
 			tegra_spi_transfer_delay(xfer->delay_usecs);
 			goto exit;
-		} else if (msg->transfers.prev == &xfer->transfer_list) {
-			/* This is the last transfer in message */
+		} else if (list_is_last(&xfer->transfer_list,
+					&msg->transfers)) {
 			if (xfer->cs_change)
 				tspi->cs_control = spi;
 			else {