Commit 578fcb8e authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab

[media] lirc_dev: sanitize function and struct names a bit

Use names that clearly identify functions as lirc functions.
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4cce492b
...@@ -72,7 +72,7 @@ static struct class *lirc_class; ...@@ -72,7 +72,7 @@ static struct class *lirc_class;
/* helper function /* helper function
* initializes the irctl structure * initializes the irctl structure
*/ */
static void init_irctl(struct irctl *ir) static void lirc_irctl_init(struct irctl *ir)
{ {
dev_dbg(ir->d.dev, LOGHEAD "initializing irctl\n", dev_dbg(ir->d.dev, LOGHEAD "initializing irctl\n",
ir->d.name, ir->d.minor); ir->d.name, ir->d.minor);
...@@ -80,7 +80,7 @@ static void init_irctl(struct irctl *ir) ...@@ -80,7 +80,7 @@ static void init_irctl(struct irctl *ir)
ir->d.minor = NOPLUG; ir->d.minor = NOPLUG;
} }
static void cleanup(struct irctl *ir) static void lirc_irctl_cleanup(struct irctl *ir)
{ {
dev_dbg(ir->d.dev, LOGHEAD "cleaning up\n", ir->d.name, ir->d.minor); dev_dbg(ir->d.dev, LOGHEAD "cleaning up\n", ir->d.name, ir->d.minor);
...@@ -97,7 +97,7 @@ static void cleanup(struct irctl *ir) ...@@ -97,7 +97,7 @@ static void cleanup(struct irctl *ir)
* reads key codes from driver and puts them into buffer * reads key codes from driver and puts them into buffer
* returns 0 on success * returns 0 on success
*/ */
static int add_to_buf(struct irctl *ir) static int lirc_add_to_buf(struct irctl *ir)
{ {
if (ir->d.add_to_buf) { if (ir->d.add_to_buf) {
int res = -ENODATA; int res = -ENODATA;
...@@ -140,7 +140,7 @@ static int lirc_thread(void *irctl) ...@@ -140,7 +140,7 @@ static int lirc_thread(void *irctl)
} }
if (kthread_should_stop()) if (kthread_should_stop())
break; break;
if (!add_to_buf(ir)) if (!lirc_add_to_buf(ir))
wake_up_interruptible(&ir->buf->wait_poll); wake_up_interruptible(&ir->buf->wait_poll);
} else { } else {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
...@@ -155,7 +155,7 @@ static int lirc_thread(void *irctl) ...@@ -155,7 +155,7 @@ static int lirc_thread(void *irctl)
} }
static struct file_operations fops = { static struct file_operations lirc_dev_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = lirc_dev_fop_read, .read = lirc_dev_fop_read,
.write = lirc_dev_fop_write, .write = lirc_dev_fop_write,
...@@ -177,7 +177,7 @@ static int lirc_cdev_add(struct irctl *ir) ...@@ -177,7 +177,7 @@ static int lirc_cdev_add(struct irctl *ir)
cdev_init(&ir->cdev, d->fops); cdev_init(&ir->cdev, d->fops);
ir->cdev.owner = d->owner; ir->cdev.owner = d->owner;
} else { } else {
cdev_init(&ir->cdev, &fops); cdev_init(&ir->cdev, &lirc_dev_fops);
ir->cdev.owner = THIS_MODULE; ir->cdev.owner = THIS_MODULE;
} }
kobject_set_name(&ir->cdev.kobj, "lirc%d", d->minor); kobject_set_name(&ir->cdev.kobj, "lirc%d", d->minor);
...@@ -280,7 +280,7 @@ int lirc_register_driver(struct lirc_driver *d) ...@@ -280,7 +280,7 @@ int lirc_register_driver(struct lirc_driver *d)
err = -ENOMEM; err = -ENOMEM;
goto out_lock; goto out_lock;
} }
init_irctl(ir); lirc_irctl_init(ir);
irctls[minor] = ir; irctls[minor] = ir;
d->minor = minor; d->minor = minor;
...@@ -401,7 +401,7 @@ int lirc_unregister_driver(int minor) ...@@ -401,7 +401,7 @@ int lirc_unregister_driver(int minor)
mutex_unlock(&ir->irctl_lock); mutex_unlock(&ir->irctl_lock);
cdev_del(&ir->cdev); cdev_del(&ir->cdev);
} else { } else {
cleanup(ir); lirc_irctl_cleanup(ir);
cdev_del(&ir->cdev); cdev_del(&ir->cdev);
kfree(ir); kfree(ir);
irctls[minor] = NULL; irctls[minor] = NULL;
...@@ -484,7 +484,7 @@ int lirc_dev_fop_close(struct inode *inode, struct file *file) ...@@ -484,7 +484,7 @@ int lirc_dev_fop_close(struct inode *inode, struct file *file)
ir->d.set_use_dec(ir->d.data); ir->d.set_use_dec(ir->d.data);
module_put(ir->d.owner); module_put(ir->d.owner);
} else { } else {
cleanup(ir); lirc_irctl_cleanup(ir);
irctls[ir->d.minor] = NULL; irctls[ir->d.minor] = NULL;
kfree(ir); kfree(ir);
} }
......
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