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

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

[media] zoran: use standard core lock



Use the standard core lock to take care of serializing ioctl calls and
to serialize file operations.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 8148802f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -280,8 +280,7 @@ struct zoran {
	struct videocodec *codec;	/* video codec */
	struct videocodec *vfe;	/* video front end */

	struct mutex resource_lock;	/* prevent evil stuff */
	struct mutex other_lock;	/* please merge with above */
	struct mutex lock;	/* file ops serialize lock */

	u8 initialized;		/* flag if zoran has been correctly initialized */
	int user;		/* number of current users */
+3 −3
Original line number Diff line number Diff line
@@ -1049,8 +1049,9 @@ static int zr36057_init (struct zoran *zr)
	/*
	 *   Now add the template and register the device unit.
	 */
	memcpy(zr->video_dev, &zoran_template, sizeof(zoran_template));
	*zr->video_dev = zoran_template;
	zr->video_dev->v4l2_dev = &zr->v4l2_dev;
	zr->video_dev->lock = &zr->lock;
	strcpy(zr->video_dev->name, ZR_DEVNAME(zr));
	/* It's not a mem2mem device, but you can both capture and output from
	   one and the same device. This should really be split up into two
@@ -1220,8 +1221,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	zr->id = nr;
	snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
	spin_lock_init(&zr->spinlock);
	mutex_init(&zr->resource_lock);
	mutex_init(&zr->other_lock);
	mutex_init(&zr->lock);
	if (pci_enable_device(pdev))
		goto zr_unreg;
	zr->revision = zr->pci_dev->revision;
+56 −193

File changed.

Preview size limit exceeded, changes collapsed.