diff mbox series

[22/23] media: atomisp: Cleanup atomisp_isr_thread() spinlock handling

Message ID 20240415120220.219480-23-hdegoede@redhat.com
State New
Headers show
Series media: atomisp: Further media-controller related fixes + dead code removal | expand

Commit Message

Hans de Goede April 15, 2024, 12:02 p.m. UTC
Refactor the code a tiny bit to avoid the need to have 2 different
paths with spin_unlock_irqrestore() in there.

While at it also remove the non helpful dev_dbg() message.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp_cmd.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
index 335f142c1fc5..2c95fd6505e0 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
@@ -959,18 +959,15 @@  irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr)
 {
 	struct atomisp_device *isp = isp_ptr;
 	unsigned long flags;
-
-	dev_dbg(isp->dev, ">%s\n", __func__);
+	bool streaming;
 
 	spin_lock_irqsave(&isp->lock, flags);
-
-	if (!isp->asd.streaming) {
-		spin_unlock_irqrestore(&isp->lock, flags);
-		return IRQ_HANDLED;
-	}
-
+	streaming = isp->asd.streaming;
 	spin_unlock_irqrestore(&isp->lock, flags);
 
+	if (!streaming)
+		return IRQ_HANDLED;
+
 	/*
 	 * The standard CSS2.0 API tells the following calling sequence of
 	 * dequeue ready buffers: