summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-keytable.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab2010-03-13 01:18:14 +0100
committerMauro Carvalho Chehab2010-05-18 05:47:05 +0200
commit727e625cc2c114e449a78f851b0c12edac897a83 (patch)
treeec7b14d68fb1b79d636d50756082e61360610063 /drivers/media/IR/ir-keytable.c
parentV4L/DVB: ir-core: Export IR name via uevent (diff)
downloadkernel-qcow2-linux-727e625cc2c114e449a78f851b0c12edac897a83.tar.gz
kernel-qcow2-linux-727e625cc2c114e449a78f851b0c12edac897a83.tar.xz
kernel-qcow2-linux-727e625cc2c114e449a78f851b0c12edac897a83.zip
V4L/DVB: ir-core: export driver name used by IR via uevent
Now, both driver and keytable names are exported to userspace. This will help userspace to decide when a table need to be replaced by another one. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-keytable.c')
-rw-r--r--drivers/media/IR/ir-keytable.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 6db3ff74659b..73fe4bec83bc 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -404,7 +404,8 @@ EXPORT_SYMBOL_GPL(ir_g_keycode_from_table);
*/
int ir_input_register(struct input_dev *input_dev,
const struct ir_scancode_table *rc_tab,
- const struct ir_dev_props *props)
+ const struct ir_dev_props *props,
+ const char *driver_name)
{
struct ir_input_dev *ir_dev;
struct ir_scancode *keymap = rc_tab->scan;
@@ -419,6 +420,10 @@ int ir_input_register(struct input_dev *input_dev,
spin_lock_init(&ir_dev->rc_tab.lock);
+ ir_dev->driver_name = kmalloc(strlen(driver_name) + 1, GFP_KERNEL);
+ if (!ir_dev->driver_name)
+ return -ENOMEM;
+ strcpy(ir_dev->driver_name, driver_name);
ir_dev->rc_tab.name = rc_tab->name;
ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size);
ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size *