diff options
author | Jarod Wilson <jarod@redhat.com> | 2010-10-16 21:32:44 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-22 20:05:35 -0200 |
commit | 90dc4cfa2076cdc4df4c2f5dd3cadeefd9557c2c (patch) | |
tree | 9e8338bff820643e1d84f8f9db5044fcf185e79f /drivers/media/IR | |
parent | 578fcb8e5f3046493932105c404792a2fe0e066f (diff) | |
download | blackbird-op-linux-90dc4cfa2076cdc4df4c2f5dd3cadeefd9557c2c.tar.gz blackbird-op-linux-90dc4cfa2076cdc4df4c2f5dd3cadeefd9557c2c.zip |
[media] lirc_dev: fix pointer to owner
If an lirc device driver doesn't specify its own fops, we set set
ir->cdev.owner to THIS_MODULE. If it does specify its own fops, we
set ir->cdev.owner to ir->d.owner. Subsequent module_{get,put} calls
should be using ir->cdev.owner, not ir->d.owner.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r-- | drivers/media/IR/lirc_dev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/IR/lirc_dev.c b/drivers/media/IR/lirc_dev.c index 560c35609ca4..19a16cef7d65 100644 --- a/drivers/media/IR/lirc_dev.c +++ b/drivers/media/IR/lirc_dev.c @@ -397,7 +397,7 @@ int lirc_unregister_driver(int minor) wake_up_interruptible(&ir->buf->wait_poll); mutex_lock(&ir->irctl_lock); ir->d.set_use_dec(ir->d.data); - module_put(ir->d.owner); + module_put(ir->cdev.owner); mutex_unlock(&ir->irctl_lock); cdev_del(&ir->cdev); } else { @@ -446,12 +446,12 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file) goto error; } - if (try_module_get(ir->d.owner)) { + if (try_module_get(ir->cdev.owner)) { ++ir->open; retval = ir->d.set_use_inc(ir->d.data); if (retval) { - module_put(ir->d.owner); + module_put(ir->cdev.owner); --ir->open; } else { lirc_buffer_clear(ir->buf); @@ -482,7 +482,7 @@ int lirc_dev_fop_close(struct inode *inode, struct file *file) --ir->open; if (ir->attached) { ir->d.set_use_dec(ir->d.data); - module_put(ir->d.owner); + module_put(ir->cdev.owner); } else { lirc_irctl_cleanup(ir); irctls[ir->d.minor] = NULL; |