aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-keytable.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-12-13 14:00:08 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:23 -0500
commit4714eda87748f226833c32400ab60dd6a3b80766 (patch)
tree7bffe980fa51169f78c9ec35c09936d8dce73443 /drivers/media/IR/ir-keytable.c
parent60b341b778cc2929df16c0a504c91621b3c6a4ad (diff)
V4L/DVB (13633): ir-core: create a new class for remote controllers
Add sysfs skeleton to export remote controller information via /sys/class/irrcv. For now, the code doesn't do much. It just exports an attribute that is meant to report and control the IR protocol used by the keytable. However, the callbacks for this new attribute weren't set yet. Also, it lacks symlinks to the used event interface. 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.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index b521ed9d6e2e..8097561ec66f 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -447,12 +447,21 @@ int ir_input_register(struct input_dev *input_dev,
447 input_set_drvdata(input_dev, ir_dev); 447 input_set_drvdata(input_dev, ir_dev);
448 448
449 rc = input_register_device(input_dev); 449 rc = input_register_device(input_dev);
450 if (rc < 0)
451 goto err;
452
453 rc = ir_register_class(input_dev);
450 if (rc < 0) { 454 if (rc < 0) {
451 kfree(rc_tab->scan); 455 input_unregister_device(input_dev);
452 kfree(ir_dev); 456 goto err;
453 input_set_drvdata(input_dev, NULL);
454 } 457 }
455 458
459 return 0;
460
461err:
462 kfree(rc_tab->scan);
463 kfree(ir_dev);
464 input_set_drvdata(input_dev, NULL);
456 return rc; 465 return rc;
457} 466}
458EXPORT_SYMBOL_GPL(ir_input_register); 467EXPORT_SYMBOL_GPL(ir_input_register);
@@ -472,6 +481,8 @@ void ir_input_unregister(struct input_dev *dev)
472 kfree(rc_tab->scan); 481 kfree(rc_tab->scan);
473 rc_tab->scan = NULL; 482 rc_tab->scan = NULL;
474 483
484 ir_unregister_class(dev);
485
475 kfree(ir_dev); 486 kfree(ir_dev);
476 input_unregister_device(dev); 487 input_unregister_device(dev);
477} 488}