[media] media: rename struct lirc_driver to struct lirc_dev
This is in preparation for the later patches which do away with struct irctl entirely. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
这个提交包含在:
@@ -35,7 +35,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
|
||||
struct lirc_codec *lirc = &dev->raw->lirc;
|
||||
int sample;
|
||||
|
||||
if (!dev->raw->lirc.drv || !dev->raw->lirc.drv->rbuf)
|
||||
if (!dev->raw->lirc.ldev || !dev->raw->lirc.ldev->rbuf)
|
||||
return -EINVAL;
|
||||
|
||||
/* Packet start */
|
||||
@@ -84,8 +84,8 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
|
||||
(u64)LIRC_VALUE_MASK);
|
||||
|
||||
gap_sample = LIRC_SPACE(lirc->gap_duration);
|
||||
lirc_buffer_write(dev->raw->lirc.drv->rbuf,
|
||||
(unsigned char *) &gap_sample);
|
||||
lirc_buffer_write(dev->raw->lirc.ldev->rbuf,
|
||||
(unsigned char *)&gap_sample);
|
||||
lirc->gap = false;
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
|
||||
TO_US(ev.duration), TO_STR(ev.pulse));
|
||||
}
|
||||
|
||||
lirc_buffer_write(dev->raw->lirc.drv->rbuf,
|
||||
lirc_buffer_write(dev->raw->lirc.ldev->rbuf,
|
||||
(unsigned char *) &sample);
|
||||
wake_up(&dev->raw->lirc.drv->rbuf->wait_poll);
|
||||
wake_up(&dev->raw->lirc.ldev->rbuf->wait_poll);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -343,12 +343,12 @@ static const struct file_operations lirc_fops = {
|
||||
|
||||
static int ir_lirc_register(struct rc_dev *dev)
|
||||
{
|
||||
struct lirc_driver *drv;
|
||||
struct lirc_dev *ldev;
|
||||
int rc = -ENOMEM;
|
||||
unsigned long features = 0;
|
||||
|
||||
drv = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
|
||||
if (!drv)
|
||||
ldev = kzalloc(sizeof(*ldev), GFP_KERNEL);
|
||||
if (!ldev)
|
||||
return rc;
|
||||
|
||||
if (dev->driver_type != RC_DRIVER_IR_RAW_TX) {
|
||||
@@ -380,29 +380,29 @@ static int ir_lirc_register(struct rc_dev *dev)
|
||||
if (dev->max_timeout)
|
||||
features |= LIRC_CAN_SET_REC_TIMEOUT;
|
||||
|
||||
snprintf(drv->name, sizeof(drv->name), "ir-lirc-codec (%s)",
|
||||
snprintf(ldev->name, sizeof(ldev->name), "ir-lirc-codec (%s)",
|
||||
dev->driver_name);
|
||||
drv->features = features;
|
||||
drv->data = &dev->raw->lirc;
|
||||
drv->rbuf = NULL;
|
||||
drv->code_length = sizeof(struct ir_raw_event) * 8;
|
||||
drv->chunk_size = sizeof(int);
|
||||
drv->buffer_size = LIRCBUF_SIZE;
|
||||
drv->fops = &lirc_fops;
|
||||
drv->dev = &dev->dev;
|
||||
drv->rdev = dev;
|
||||
drv->owner = THIS_MODULE;
|
||||
ldev->features = features;
|
||||
ldev->data = &dev->raw->lirc;
|
||||
ldev->rbuf = NULL;
|
||||
ldev->code_length = sizeof(struct ir_raw_event) * 8;
|
||||
ldev->chunk_size = sizeof(int);
|
||||
ldev->buffer_size = LIRCBUF_SIZE;
|
||||
ldev->fops = &lirc_fops;
|
||||
ldev->dev = &dev->dev;
|
||||
ldev->rdev = dev;
|
||||
ldev->owner = THIS_MODULE;
|
||||
|
||||
rc = lirc_register_driver(drv);
|
||||
rc = lirc_register_device(ldev);
|
||||
if (rc < 0)
|
||||
goto out;
|
||||
|
||||
dev->raw->lirc.drv = drv;
|
||||
dev->raw->lirc.ldev = ldev;
|
||||
dev->raw->lirc.dev = dev;
|
||||
return 0;
|
||||
|
||||
out:
|
||||
kfree(drv);
|
||||
kfree(ldev);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -410,9 +410,9 @@ static int ir_lirc_unregister(struct rc_dev *dev)
|
||||
{
|
||||
struct lirc_codec *lirc = &dev->raw->lirc;
|
||||
|
||||
lirc_unregister_driver(lirc->drv);
|
||||
kfree(lirc->drv);
|
||||
lirc->drv = NULL;
|
||||
lirc_unregister_device(lirc->ldev);
|
||||
kfree(lirc->ldev);
|
||||
lirc->ldev = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@
|
||||
static dev_t lirc_base_dev;
|
||||
|
||||
struct irctl {
|
||||
struct lirc_driver d;
|
||||
struct lirc_dev d;
|
||||
bool attached;
|
||||
int open;
|
||||
|
||||
@@ -76,7 +76,7 @@ static void lirc_release(struct device *ld)
|
||||
static int lirc_allocate_buffer(struct irctl *ir)
|
||||
{
|
||||
int err = 0;
|
||||
struct lirc_driver *d = &ir->d;
|
||||
struct lirc_dev *d = &ir->d;
|
||||
|
||||
if (d->rbuf) {
|
||||
ir->buf = d->rbuf;
|
||||
@@ -103,7 +103,7 @@ out:
|
||||
return err;
|
||||
}
|
||||
|
||||
int lirc_register_driver(struct lirc_driver *d)
|
||||
int lirc_register_device(struct lirc_dev *d)
|
||||
{
|
||||
struct irctl *ir;
|
||||
int minor;
|
||||
@@ -204,9 +204,9 @@ int lirc_register_driver(struct lirc_driver *d)
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(lirc_register_driver);
|
||||
EXPORT_SYMBOL(lirc_register_device);
|
||||
|
||||
void lirc_unregister_driver(struct lirc_driver *d)
|
||||
void lirc_unregister_device(struct lirc_dev *d)
|
||||
{
|
||||
struct irctl *ir;
|
||||
|
||||
@@ -234,7 +234,7 @@ void lirc_unregister_driver(struct lirc_driver *d)
|
||||
ida_simple_remove(&lirc_ida, d->minor);
|
||||
put_device(&ir->dev);
|
||||
}
|
||||
EXPORT_SYMBOL(lirc_unregister_driver);
|
||||
EXPORT_SYMBOL(lirc_unregister_device);
|
||||
|
||||
int lirc_dev_fop_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
|
@@ -106,7 +106,7 @@ struct ir_raw_event_ctrl {
|
||||
} mce_kbd;
|
||||
struct lirc_codec {
|
||||
struct rc_dev *dev;
|
||||
struct lirc_driver *drv;
|
||||
struct lirc_dev *ldev;
|
||||
int carrier_low;
|
||||
|
||||
ktime_t gap_start;
|
||||
|
在新工单中引用
屏蔽一个用户