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

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

[media] ivtv: embed video_device



Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent b3226f96
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ static int ivtv_alsa_load(struct ivtv *itv)
	}

	s = &itv->streams[IVTV_ENC_STREAM_TYPE_PCM];
	if (s->vdev == NULL) {
	if (s->vdev.v4l2_dev == NULL) {
		IVTV_DEBUG_ALSA_INFO("%s: PCM stream for card is disabled - "
				     "skipping\n", __func__);
		return 0;
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ static int snd_ivtv_pcm_capture_open(struct snd_pcm_substream *substream)

	s = &itv->streams[IVTV_ENC_STREAM_TYPE_PCM];

	v4l2_fh_init(&item.fh, s->vdev);
	v4l2_fh_init(&item.fh, &s->vdev);
	item.itv = itv;
	item.type = s->type;

+2 −2
Original line number Diff line number Diff line
@@ -1284,7 +1284,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
	return 0;

free_streams:
	ivtv_streams_cleanup(itv, 1);
	ivtv_streams_cleanup(itv);
free_irq:
	free_irq(itv->pdev->irq, (void *)itv);
free_i2c:
@@ -1444,7 +1444,7 @@ static void ivtv_remove(struct pci_dev *pdev)
	flush_kthread_worker(&itv->irq_worker);
	kthread_stop(itv->irq_worker_task);

	ivtv_streams_cleanup(itv, 1);
	ivtv_streams_cleanup(itv);
	ivtv_udma_free(itv);

	v4l2_ctrl_handler_free(&itv->cxhdl.hdl);
+1 −1
Original line number Diff line number Diff line
@@ -327,7 +327,7 @@ struct ivtv; /* forward reference */
struct ivtv_stream {
	/* These first four fields are always set, even if the stream
	   is not actually created. */
	struct video_device *vdev;	/* NULL when stream not created */
	struct video_device vdev;	/* vdev.v4l2_dev is NULL if there is no device */
	struct ivtv *itv; 		/* for ease of use */
	const char *name;		/* name of the stream */
	int type;			/* stream type */
+1 −1
Original line number Diff line number Diff line
@@ -995,7 +995,7 @@ static int ivtv_open(struct file *filp)
		IVTV_DEBUG_WARN("nomem on v4l2 open\n");
		return -ENOMEM;
	}
	v4l2_fh_init(&item->fh, s->vdev);
	v4l2_fh_init(&item->fh, &s->vdev);
	item->itv = itv;
	item->type = s->type;

Loading