diff options
-rw-r--r-- | drivers/spi/spi-rspi.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 5f122d9d2063..00c32320dce8 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -564,8 +564,12 @@ static void rspi_work(struct work_struct *work) | |||
564 | unsigned long flags; | 564 | unsigned long flags; |
565 | int ret; | 565 | int ret; |
566 | 566 | ||
567 | spin_lock_irqsave(&rspi->lock, flags); | 567 | while (1) { |
568 | while (!list_empty(&rspi->queue)) { | 568 | spin_lock_irqsave(&rspi->lock, flags); |
569 | if (list_empty(&rspi->queue)) { | ||
570 | spin_unlock_irqrestore(&rspi->lock, flags); | ||
571 | break; | ||
572 | } | ||
569 | mesg = list_entry(rspi->queue.next, struct spi_message, queue); | 573 | mesg = list_entry(rspi->queue.next, struct spi_message, queue); |
570 | list_del_init(&mesg->queue); | 574 | list_del_init(&mesg->queue); |
571 | spin_unlock_irqrestore(&rspi->lock, flags); | 575 | spin_unlock_irqrestore(&rspi->lock, flags); |
@@ -595,8 +599,6 @@ static void rspi_work(struct work_struct *work) | |||
595 | 599 | ||
596 | mesg->status = 0; | 600 | mesg->status = 0; |
597 | mesg->complete(mesg->context); | 601 | mesg->complete(mesg->context); |
598 | |||
599 | spin_lock_irqsave(&rspi->lock, flags); | ||
600 | } | 602 | } |
601 | 603 | ||
602 | return; | 604 | return; |