Commit 384c3689 authored by Ingo Molnar's avatar Ingo Molnar Committed by Mauro Carvalho Chehab

V4L/DVB (3568g): sem2mutex: zoran

Semaphore to mutexes conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 6201573c
...@@ -395,7 +395,7 @@ struct zoran { ...@@ -395,7 +395,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 semaphore resource_lock; /* prevent evil stuff */ struct mutex resource_lock; /* prevent evil stuff */
u8 initialized; /* flag if zoran has been correctly initalized */ u8 initialized; /* flag if zoran has been correctly initalized */
int user; /* number of current users */ int user; /* number of current users */
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/video_decoder.h> #include <linux/video_decoder.h>
#include <linux/video_encoder.h> #include <linux/video_encoder.h>
#include <linux/mutex.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -673,7 +674,7 @@ zoran_i2c_client_register (struct i2c_client *client) ...@@ -673,7 +674,7 @@ zoran_i2c_client_register (struct i2c_client *client)
KERN_DEBUG "%s: i2c_client_register() - driver id = %d\n", KERN_DEBUG "%s: i2c_client_register() - driver id = %d\n",
ZR_DEVNAME(zr), client->driver->id); ZR_DEVNAME(zr), client->driver->id);
down(&zr->resource_lock); mutex_lock(&zr->resource_lock);
if (zr->user > 0) { if (zr->user > 0) {
/* we're already busy, so we keep a reference to /* we're already busy, so we keep a reference to
...@@ -694,7 +695,7 @@ zoran_i2c_client_register (struct i2c_client *client) ...@@ -694,7 +695,7 @@ zoran_i2c_client_register (struct i2c_client *client)
} }
clientreg_unlock_and_return: clientreg_unlock_and_return:
up(&zr->resource_lock); mutex_unlock(&zr->resource_lock);
return res; return res;
} }
...@@ -707,7 +708,7 @@ zoran_i2c_client_unregister (struct i2c_client *client) ...@@ -707,7 +708,7 @@ zoran_i2c_client_unregister (struct i2c_client *client)
dprintk(2, KERN_DEBUG "%s: i2c_client_unregister()\n", ZR_DEVNAME(zr)); dprintk(2, KERN_DEBUG "%s: i2c_client_unregister()\n", ZR_DEVNAME(zr));
down(&zr->resource_lock); mutex_lock(&zr->resource_lock);
if (zr->user > 0) { if (zr->user > 0) {
res = -EBUSY; res = -EBUSY;
...@@ -722,7 +723,7 @@ zoran_i2c_client_unregister (struct i2c_client *client) ...@@ -722,7 +723,7 @@ zoran_i2c_client_unregister (struct i2c_client *client)
snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%d]", zr->id); snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%d]", zr->id);
} }
clientunreg_unlock_and_return: clientunreg_unlock_and_return:
up(&zr->resource_lock); mutex_unlock(&zr->resource_lock);
return res; return res;
} }
...@@ -1202,7 +1203,7 @@ find_zr36057 (void) ...@@ -1202,7 +1203,7 @@ find_zr36057 (void)
zr->id = zoran_num; zr->id = zoran_num;
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);
init_MUTEX(&zr->resource_lock); mutex_init(&zr->resource_lock);
if (pci_enable_device(dev)) if (pci_enable_device(dev))
continue; continue;
zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0); zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0);
......
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