spi: Use list_last_entry at appropriate places
Subsystems (4)
PATCH 1/1 spi: Use list_last_entry at appropriate places
Signed-off-by Axel Lin <[email protected]>
--- drivers/spi/spi-dw.c | 3 +-- drivers/spi/spi-pl022.c | 5 ++--- drivers/spi/spi-pxa2xx.c | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/spi/spi-dw.c +1 -2
@@ -276,8 +276,7 @@ static void giveback(struct dw_spi *dws)queue_work (dws->workqueue, &dws->pump_messages);spin_unlock_irqrestore (&dws->lock, flags); - last_transfer =list_entry (msg->transfers.prev, - struct spi_transfer, + last_transfer = list_last_entry(&msg->transfers, struct spi_transfer, transfer_list);if (!last_transfer->cs_change && dws->cs_control)
drivers/spi/spi-pl022.c +2 -3
@@ -459,9 +459,8 @@ static void giveback(struct pl022 *pl022)struct spi_transfer *last_transfer; pl022->next_msg_cs_active = false; - last_transfer =list_entry (pl022->cur_msg->transfers.prev, - struct spi_transfer, - transfer_list); + last_transfer =list_last_entry (&pl022->cur_msg->transfers, + struct spi_transfer, transfer_list);/* Delay if requested before any change in chip select */ if (last_transfer->delay_usecs)
drivers/spi/spi-pxa2xx.c +1 -2
@@ -362,8 +362,7 @@ static void giveback(struct driver_data *drv_data) drv_data->cur_msg =NULL ; drv_data->cur_transfer =NULL ; - last_transfer =list_entry (msg->transfers.prev, - struct spi_transfer, + last_transfer = list_last_entry(&msg->transfers, struct spi_transfer, transfer_list);/* Delay if requested before any change in chip select */
Signature · 8 lines
1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Mark Brown
AppliedQuoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Applied, thanks. Coccinelle ought to be able to figure this one out - might be worth teaching it.