Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242154
b: refs/heads/master
c: 9b28500
h: refs/heads/master
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent 45804be commit 02cb849
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 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: 12d896e1c17978599a98510fdfaff27a4e82c0bf
refs/heads/master: 9b28500a59d7ee5da5adb43bcb384391cac401c4
32 changes: 1 addition & 31 deletions trunk/drivers/staging/lirc/lirc_zilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,34 +305,12 @@ static int lirc_thread(void *arg)

static int set_use_inc(void *data)
{
struct IR *ir = data;

if (ir->l.owner == NULL || try_module_get(ir->l.owner) == 0)
return -ENODEV;

/* lock bttv in memory while /dev/lirc is in use */
/*
* this is completely broken code. lirc_unregister_driver()
* must be possible even when the device is open
*/
if (ir->rx != NULL)
i2c_use_client(ir->rx->c);
if (ir->tx != NULL)
i2c_use_client(ir->tx->c);

return 0;
}

static void set_use_dec(void *data)
{
struct IR *ir = data;

if (ir->rx)
i2c_release_client(ir->rx->c);
if (ir->tx)
i2c_release_client(ir->tx->c);
if (ir->l.owner != NULL)
module_put(ir->l.owner);
return;
}

/* safe read of a uint32 (always network byte order) */
Expand Down Expand Up @@ -1098,7 +1076,6 @@ static struct IR *find_ir_device_by_minor(unsigned int minor)
static int open(struct inode *node, struct file *filep)
{
struct IR *ir;
int ret;
unsigned int minor = MINOR(node->i_rdev);

/* find our IR struct */
Expand All @@ -1112,12 +1089,6 @@ static int open(struct inode *node, struct file *filep)
/* increment in use count */
mutex_lock(&ir->ir_lock);
++ir->open;
ret = set_use_inc(ir);
if (ret != 0) {
--ir->open;
mutex_unlock(&ir->ir_lock);
return ret;
}
mutex_unlock(&ir->ir_lock);

/* stash our IR struct */
Expand All @@ -1139,7 +1110,6 @@ static int close(struct inode *node, struct file *filep)
/* decrement in use count */
mutex_lock(&ir->ir_lock);
--ir->open;
set_use_dec(ir);
mutex_unlock(&ir->ir_lock);

return 0;
Expand Down

0 comments on commit 02cb849

Please sign in to comment.