Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23271
b: refs/heads/master
c: 384c368
h: refs/heads/master
i:
  23269: be9c085
  23267: 3232ce0
  23263: 3040724
v: v3
  • Loading branch information
Ingo Molnar authored and Mauro Carvalho Chehab committed Mar 23, 2006
1 parent f6c49cd commit 99f10c1
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 120 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6201573cc9bfe1e0bdec229bed8e95b0dc88a587
refs/heads/master: 384c36893f94e0e2145832cf2f20684ae372aee5
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/zoran.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ struct zoran {
struct videocodec *codec; /* video codec */
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 */
int user; /* number of current users */
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/media/video/zoran_card.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/interrupt.h>
#include <linux/video_decoder.h>
#include <linux/video_encoder.h>
#include <linux/mutex.h>

#include <asm/io.h>

Expand Down Expand Up @@ -673,7 +674,7 @@ zoran_i2c_client_register (struct i2c_client *client)
KERN_DEBUG "%s: i2c_client_register() - driver id = %d\n",
ZR_DEVNAME(zr), client->driver->id);

down(&zr->resource_lock);
mutex_lock(&zr->resource_lock);

if (zr->user > 0) {
/* we're already busy, so we keep a reference to
Expand All @@ -694,7 +695,7 @@ zoran_i2c_client_register (struct i2c_client *client)
}

clientreg_unlock_and_return:
up(&zr->resource_lock);
mutex_unlock(&zr->resource_lock);

return res;
}
Expand All @@ -707,7 +708,7 @@ zoran_i2c_client_unregister (struct i2c_client *client)

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) {
res = -EBUSY;
Expand All @@ -722,7 +723,7 @@ zoran_i2c_client_unregister (struct i2c_client *client)
snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%d]", zr->id);
}
clientunreg_unlock_and_return:
up(&zr->resource_lock);
mutex_unlock(&zr->resource_lock);
return res;
}

Expand Down Expand Up @@ -1202,7 +1203,7 @@ find_zr36057 (void)
zr->id = zoran_num;
snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
spin_lock_init(&zr->spinlock);
init_MUTEX(&zr->resource_lock);
mutex_init(&zr->resource_lock);
if (pci_enable_device(dev))
continue;
zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0);
Expand Down
Loading

0 comments on commit 99f10c1

Please sign in to comment.