aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-octeon.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-01-15 00:22:17 -0500
committerMark Brown <broonie@linaro.org>2014-02-03 07:22:18 -0500
commit0a4e210e9965de3812df079fc70a702afc4445d2 (patch)
tree11f8921245b98ecf2f220fc3bbb26fb0dda3d4ed /drivers/spi/spi-octeon.c
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
spi: octeon: Use list_is_last() instead of open-coded
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-octeon.c')
-rw-r--r--drivers/spi/spi-octeon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi-octeon.c b/drivers/spi/spi-octeon.c
index 67249a48b391..862ef30853d3 100644
--- a/drivers/spi/spi-octeon.c
+++ b/drivers/spi/spi-octeon.c
@@ -179,7 +179,8 @@ static int octeon_spi_transfer_one_message(struct spi_master *master,
179 } 179 }
180 180
181 list_for_each_entry(xfer, &msg->transfers, transfer_list) { 181 list_for_each_entry(xfer, &msg->transfers, transfer_list) {
182 bool last_xfer = &xfer->transfer_list == msg->transfers.prev; 182 bool last_xfer = list_is_last(&xfer->transfer_list,
183 &msg->transfers);
183 int r = octeon_spi_do_transfer(p, msg, xfer, last_xfer); 184 int r = octeon_spi_do_transfer(p, msg, xfer, last_xfer);
184 if (r < 0) { 185 if (r < 0) {
185 status = r; 186 status = r;