diff options
| -rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index c8b672e07ba0..35f60bd252dd 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c | |||
| @@ -615,7 +615,7 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw) | |||
| 615 | int size; | 615 | int size; |
| 616 | u32 n_writes; | 616 | u32 n_writes; |
| 617 | int j; | 617 | int j; |
| 618 | struct spi_message *pmsg; | 618 | struct spi_message *pmsg, *tmp; |
| 619 | const u8 *tx_buf; | 619 | const u8 *tx_buf; |
| 620 | const u16 *tx_sbuf; | 620 | const u16 *tx_sbuf; |
| 621 | 621 | ||
| @@ -656,7 +656,7 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw) | |||
| 656 | if (!data->pkt_rx_buff) { | 656 | if (!data->pkt_rx_buff) { |
| 657 | /* flush queue and set status of all transfers to -ENOMEM */ | 657 | /* flush queue and set status of all transfers to -ENOMEM */ |
| 658 | dev_err(&data->master->dev, "%s :kzalloc failed\n", __func__); | 658 | dev_err(&data->master->dev, "%s :kzalloc failed\n", __func__); |
| 659 | list_for_each_entry(pmsg, data->queue.next, queue) { | 659 | list_for_each_entry_safe(pmsg, tmp, data->queue.next, queue) { |
| 660 | pmsg->status = -ENOMEM; | 660 | pmsg->status = -ENOMEM; |
| 661 | 661 | ||
| 662 | if (pmsg->complete != 0) | 662 | if (pmsg->complete != 0) |
| @@ -703,7 +703,7 @@ static void pch_spi_set_tx(struct pch_spi_data *data, int *bpw) | |||
| 703 | 703 | ||
| 704 | static void pch_spi_nomore_transfer(struct pch_spi_data *data) | 704 | static void pch_spi_nomore_transfer(struct pch_spi_data *data) |
| 705 | { | 705 | { |
| 706 | struct spi_message *pmsg; | 706 | struct spi_message *pmsg, *tmp; |
| 707 | dev_dbg(&data->master->dev, "%s called\n", __func__); | 707 | dev_dbg(&data->master->dev, "%s called\n", __func__); |
| 708 | /* Invoke complete callback | 708 | /* Invoke complete callback |
| 709 | * [To the spi core..indicating end of transfer] */ | 709 | * [To the spi core..indicating end of transfer] */ |
| @@ -740,7 +740,7 @@ static void pch_spi_nomore_transfer(struct pch_spi_data *data) | |||
| 740 | dev_dbg(&data->master->dev, | 740 | dev_dbg(&data->master->dev, |
| 741 | "%s suspend/remove initiated, flushing queue\n", | 741 | "%s suspend/remove initiated, flushing queue\n", |
| 742 | __func__); | 742 | __func__); |
| 743 | list_for_each_entry(pmsg, data->queue.next, queue) { | 743 | list_for_each_entry_safe(pmsg, tmp, data->queue.next, queue) { |
| 744 | pmsg->status = -EIO; | 744 | pmsg->status = -EIO; |
| 745 | 745 | ||
| 746 | if (pmsg->complete) | 746 | if (pmsg->complete) |
| @@ -1187,7 +1187,7 @@ static void pch_spi_handle_dma(struct pch_spi_data *data, int *bpw) | |||
| 1187 | 1187 | ||
| 1188 | static void pch_spi_process_messages(struct work_struct *pwork) | 1188 | static void pch_spi_process_messages(struct work_struct *pwork) |
| 1189 | { | 1189 | { |
| 1190 | struct spi_message *pmsg; | 1190 | struct spi_message *pmsg, *tmp; |
| 1191 | struct pch_spi_data *data; | 1191 | struct pch_spi_data *data; |
| 1192 | int bpw; | 1192 | int bpw; |
| 1193 | 1193 | ||
| @@ -1199,7 +1199,7 @@ static void pch_spi_process_messages(struct work_struct *pwork) | |||
| 1199 | if (data->board_dat->suspend_sts || (data->status == STATUS_EXITING)) { | 1199 | if (data->board_dat->suspend_sts || (data->status == STATUS_EXITING)) { |
| 1200 | dev_dbg(&data->master->dev, "%s suspend/remove initiated," | 1200 | dev_dbg(&data->master->dev, "%s suspend/remove initiated," |
| 1201 | "flushing queue\n", __func__); | 1201 | "flushing queue\n", __func__); |
| 1202 | list_for_each_entry(pmsg, data->queue.next, queue) { | 1202 | list_for_each_entry_safe(pmsg, tmp, data->queue.next, queue) { |
| 1203 | pmsg->status = -EIO; | 1203 | pmsg->status = -EIO; |
| 1204 | 1204 | ||
| 1205 | if (pmsg->complete != 0) { | 1205 | if (pmsg->complete != 0) { |
