Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e37559b2 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] vb2: stop_streaming should return void



The vb2 core ignores any return code from the stop_streaming op.
And there really isn't anything it can do anyway in case of an error.
So change the return type to void and update any drivers that implement it.

The int return gave drivers the idea that this operation could actually
fail, but that's really not the case.

The pwc amd sdr-msi3101 drivers both had this construction:

        if (mutex_lock_interruptible(&s->v4l2_lock))
                return -ERESTARTSYS;

This has been updated to just call mutex_lock(). The stop_streaming op
expects this to really stop streaming and I very much doubt this will
work reliably if stop_streaming just returns without really stopping the
DMA.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarPawel Osciak <pawel@osciak.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent ac9687a2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 * Stop the DMA engine. Any remaining buffers in the DMA queue are dequeued
 * and passed on to the vb2 framework marked as STATE_ERROR.
 */
static int stop_streaming(struct vb2_queue *vq)
static void stop_streaming(struct vb2_queue *vq)
{
	struct skeleton *skel = vb2_get_drv_priv(vq);

@@ -277,7 +277,6 @@ static int stop_streaming(struct vb2_queue *vq)

	/* Release all active buffers */
	return_all_buffers(skel, VB2_BUF_STATE_ERROR);
	return 0;
}

/*
+1 −2
Original line number Diff line number Diff line
@@ -357,7 +357,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
}

/* abort streaming and wait for last buffer */
static int stop_streaming(struct vb2_queue *vq)
static void stop_streaming(struct vb2_queue *vq)
{
	struct sta2x11_vip *vip = vb2_get_drv_priv(vq);
	struct vip_buffer *vip_buf, *node;
@@ -374,7 +374,6 @@ static int stop_streaming(struct vb2_queue *vq)
		list_del(&vip_buf->list);
	}
	spin_unlock(&vip->lock);
	return 0;
}

static struct vb2_ops vip_video_qops = {
+1 −2
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
	return 0;
}

static int bcap_stop_streaming(struct vb2_queue *vq)
static void bcap_stop_streaming(struct vb2_queue *vq)
{
	struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
	struct ppi_if *ppi = bcap_dev->ppi;
@@ -452,7 +452,6 @@ static int bcap_stop_streaming(struct vb2_queue *vq)
		list_del(&bcap_dev->cur_frm->list);
		vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR);
	}
	return 0;
}

static struct vb2_ops bcap_video_qops = {
+1 −3
Original line number Diff line number Diff line
@@ -2269,7 +2269,7 @@ static int coda_start_streaming(struct vb2_queue *q, unsigned int count)
	return ret;
}

static int coda_stop_streaming(struct vb2_queue *q)
static void coda_stop_streaming(struct vb2_queue *q)
{
	struct coda_ctx *ctx = vb2_get_drv_priv(q);
	struct coda_dev *dev = ctx->dev;
@@ -2295,8 +2295,6 @@ static int coda_stop_streaming(struct vb2_queue *q)
			ctx->bitstream.vaddr, ctx->bitstream.size);
		ctx->runcounter = 0;
	}

	return 0;
}

static struct vb2_ops coda_qops = {
+2 −3
Original line number Diff line number Diff line
@@ -368,7 +368,7 @@ static int vpbe_start_streaming(struct vb2_queue *vq, unsigned int count)
	return ret;
}

static int vpbe_stop_streaming(struct vb2_queue *vq)
static void vpbe_stop_streaming(struct vb2_queue *vq)
{
	struct vpbe_fh *fh = vb2_get_drv_priv(vq);
	struct vpbe_layer *layer = fh->layer;
@@ -376,7 +376,7 @@ static int vpbe_stop_streaming(struct vb2_queue *vq)
	unsigned long flags;

	if (!vb2_is_streaming(vq))
		return 0;
		return;

	/* release all active buffers */
	spin_lock_irqsave(&disp->dma_queue_lock, flags);
@@ -398,7 +398,6 @@ static int vpbe_stop_streaming(struct vb2_queue *vq)
		vb2_buffer_done(&layer->next_frm->vb, VB2_BUF_STATE_ERROR);
	}
	spin_unlock_irqrestore(&disp->dma_queue_lock, flags);
	return 0;
}

static struct vb2_ops video_qops = {
Loading