aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShimoda, Yoshihiro <yoshihiro.shimoda.uh@renesas.com>2013-08-26 22:15:09 -0400
committerMark Brown <broonie@linaro.org>2013-08-27 10:55:41 -0400
commit8d4d08ce8319ae26227c4dd558405963c14c2037 (patch)
tree4213a4a7e5d68ca08b92e9523efbb2bc1b20d8ac
parente2b0509908aa5e874a1837a733422b6e8b8502b8 (diff)
spi: spi-rspi: fix inconsistent spin_lock_irqsave
This patch fixes the following Smatch warning: CHECK drivers/spi/spi-rspi.c drivers/spi/spi-rspi.c:606 rspi_work() warn: inconsistent returns spin_lock:&rspi->lock: locked (602) unlocked (606) drivers/spi/spi-rspi.c:606 rspi_work() warn: inconsistent returns irqsave:flags: locked (602) unlocked (606) Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/spi/spi-rspi.c10
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;