diff options
author | Jarod Wilson <jarod@redhat.com> | 2010-10-16 20:32:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-22 18:05:35 -0400 |
commit | 90dc4cfa2076cdc4df4c2f5dd3cadeefd9557c2c (patch) | |
tree | 9e8338bff820643e1d84f8f9db5044fcf185e79f /drivers | |
parent | 578fcb8e5f3046493932105c404792a2fe0e066f (diff) |
[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')
-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) | |||
397 | wake_up_interruptible(&ir->buf->wait_poll); | 397 | wake_up_interruptible(&ir->buf->wait_poll); |
398 | mutex_lock(&ir->irctl_lock); | 398 | mutex_lock(&ir->irctl_lock); |
399 | ir->d.set_use_dec(ir->d.data); | 399 | ir->d.set_use_dec(ir->d.data); |
400 | module_put(ir->d.owner); | 400 | module_put(ir->cdev.owner); |
401 | mutex_unlock(&ir->irctl_lock); | 401 | mutex_unlock(&ir->irctl_lock); |
402 | cdev_del(&ir->cdev); | 402 | cdev_del(&ir->cdev); |
403 | } else { | 403 | } else { |
@@ -446,12 +446,12 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file) | |||
446 | goto error; | 446 | goto error; |
447 | } | 447 | } |
448 | 448 | ||
449 | if (try_module_get(ir->d.owner)) { | 449 | if (try_module_get(ir->cdev.owner)) { |
450 | ++ir->open; | 450 | ++ir->open; |
451 | retval = ir->d.set_use_inc(ir->d.data); | 451 | retval = ir->d.set_use_inc(ir->d.data); |
452 | 452 | ||
453 | if (retval) { | 453 | if (retval) { |
454 | module_put(ir->d.owner); | 454 | module_put(ir->cdev.owner); |
455 | --ir->open; | 455 | --ir->open; |
456 | } else { | 456 | } else { |
457 | lirc_buffer_clear(ir->buf); | 457 | lirc_buffer_clear(ir->buf); |
@@ -482,7 +482,7 @@ int lirc_dev_fop_close(struct inode *inode, struct file *file) | |||
482 | --ir->open; | 482 | --ir->open; |
483 | if (ir->attached) { | 483 | if (ir->attached) { |
484 | ir->d.set_use_dec(ir->d.data); | 484 | ir->d.set_use_dec(ir->d.data); |
485 | module_put(ir->d.owner); | 485 | module_put(ir->cdev.owner); |
486 | } else { | 486 | } else { |
487 | lirc_irctl_cleanup(ir); | 487 | lirc_irctl_cleanup(ir); |
488 | irctls[ir->d.minor] = NULL; | 488 | irctls[ir->d.minor] = NULL; |