提交 7b962d43 编写于 作者: H Hans Verkuil 提交者: 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: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册