[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250910205003.421067-1-karanja99erick@gmail.com>
Date: Wed, 10 Sep 2025 23:50:03 +0300
From: Erick Karanja <karanja99erick@...il.com>
To: broonie@...nel.org
Cc: linux-arm-msm@...r.kernel.org,
linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org,
julia.lawall@...ia.fr,
Erick Karanja <karanja99erick@...il.com>
Subject: [PATCH] spi: Convert lock/unlock to scoped_guard
Siplify the lock/unlock pattern with scope based cleanup.
Generated-by: Coccinelle SmPL
Signed-off-by: Erick Karanja <karanja99erick@...il.com>
---
drivers/spi/spi-qup.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 7d647edf6bc3..ad4f526a3705 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -654,10 +654,10 @@ static irqreturn_t spi_qup_qup_irq(int irq, void *dev_id)
error = -EIO;
}
- spin_lock(&controller->lock);
- if (!controller->error)
- controller->error = error;
- spin_unlock(&controller->lock);
+ scoped_guard (spinlock, &controller->lock) {
+ if (!controller->error)
+ controller->error = error;
+ }
if (spi_qup_is_dma_xfer(controller->mode)) {
writel_relaxed(opflags, controller->base + QUP_OPERATIONAL);
--
2.43.0
Powered by blists - more mailing lists