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

[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
...@@ -280,8 +280,7 @@ struct zoran { ...@@ -280,8 +280,7 @@ struct zoran {
struct videocodec *codec; /* video codec */ struct videocodec *codec; /* video codec */
struct videocodec *vfe; /* video front end */ struct videocodec *vfe; /* video front end */
struct mutex resource_lock; /* prevent evil stuff */ struct mutex lock; /* file ops serialize lock */
struct mutex other_lock; /* please merge with above */
u8 initialized; /* flag if zoran has been correctly initialized */ u8 initialized; /* flag if zoran has been correctly initialized */
int user; /* number of current users */ int user; /* number of current users */
......
...@@ -1049,8 +1049,9 @@ static int zr36057_init (struct zoran *zr) ...@@ -1049,8 +1049,9 @@ static int zr36057_init (struct zoran *zr)
/* /*
* Now add the template and register the device unit. * 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->v4l2_dev = &zr->v4l2_dev;
zr->video_dev->lock = &zr->lock;
strcpy(zr->video_dev->name, ZR_DEVNAME(zr)); strcpy(zr->video_dev->name, ZR_DEVNAME(zr));
/* It's not a mem2mem device, but you can both capture and output from /* 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 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) ...@@ -1220,8 +1221,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
zr->id = nr; zr->id = nr;
snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id); snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
spin_lock_init(&zr->spinlock); spin_lock_init(&zr->spinlock);
mutex_init(&zr->resource_lock); mutex_init(&zr->lock);
mutex_init(&zr->other_lock);
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
goto zr_unreg; goto zr_unreg;
zr->revision = zr->pci_dev->revision; zr->revision = zr->pci_dev->revision;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment