]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: rcar-vin: Fold interrupt helpers into only callers
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Mon, 16 Jun 2025 18:57:20 +0000 (20:57 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Wed, 18 Jun 2025 07:20:44 +0000 (09:20 +0200)
The call sites using the interrupt helper functions have all been
reworked to only one for each. Fold each of them into the only call
sites left.

This fixes a possible interrupt loss in case an interrupt occurs between
reading VNINTS_REG in rvin_get_interrupt_status() and reading it again
in rvin_ack_interrupt().

While at it rename the variable holding the current interrupt status to
make the code easier to read.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20250616185722.980722-2-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/renesas/rcar-vin/rcar-dma.c

index d4faa5a4e757d4d4fef56519b596eed2ec63eb78..e1dae46b06d478bb285b345b3c472462a9fb7c68 100644 (file)
@@ -903,21 +903,6 @@ static int rvin_setup(struct rvin_dev *vin)
        return 0;
 }
 
-static void rvin_disable_interrupts(struct rvin_dev *vin)
-{
-       rvin_write(vin, 0, VNIE_REG);
-}
-
-static u32 rvin_get_interrupt_status(struct rvin_dev *vin)
-{
-       return rvin_read(vin, VNINTS_REG);
-}
-
-static void rvin_ack_interrupt(struct rvin_dev *vin)
-{
-       rvin_write(vin, rvin_read(vin, VNINTS_REG), VNINTS_REG);
-}
-
 static bool rvin_capture_active(struct rvin_dev *vin)
 {
        return rvin_read(vin, VNMS_REG) & VNMS_CA;
@@ -1040,22 +1025,22 @@ static void rvin_capture_stop(struct rvin_dev *vin)
 static irqreturn_t rvin_irq(int irq, void *data)
 {
        struct rvin_dev *vin = data;
-       u32 int_status, vnms;
+       u32 status, vnms;
        int slot;
        unsigned int handled = 0;
        unsigned long flags;
 
        spin_lock_irqsave(&vin->qlock, flags);
 
-       int_status = rvin_get_interrupt_status(vin);
-       if (!int_status)
+       status = rvin_read(vin, VNINTS_REG);
+       if (!status)
                goto done;
 
-       rvin_ack_interrupt(vin);
+       rvin_write(vin, status, VNINTS_REG);
        handled = 1;
 
        /* Nothing to do if nothing was captured. */
-       if (!(int_status & VNINTS_FIS))
+       if (!(status & VNINTS_FIS))
                goto done;
 
        /* Nothing to do if not running. */
@@ -1400,7 +1385,7 @@ void rvin_stop_streaming(struct rvin_dev *vin)
        rvin_set_stream(vin, 0);
 
        /* disable interrupts */
-       rvin_disable_interrupts(vin);
+       rvin_write(vin, 0, VNIE_REG);
 
        /* Return unprocessed buffers from hardware. */
        for (unsigned int i = 0; i < HW_BUFFER_NUM; i++) {