diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-13 16:00:08 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 15:10:23 -0300 |
commit | 4714eda87748f226833c32400ab60dd6a3b80766 (patch) | |
tree | 7bffe980fa51169f78c9ec35c09936d8dce73443 /drivers/media/IR/ir-keytable.c | |
parent | 60b341b778cc2929df16c0a504c91621b3c6a4ad (diff) | |
download | kernel_samsung_aries-4714eda87748f226833c32400ab60dd6a3b80766.zip kernel_samsung_aries-4714eda87748f226833c32400ab60dd6a3b80766.tar.gz kernel_samsung_aries-4714eda87748f226833c32400ab60dd6a3b80766.tar.bz2 |
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.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index b521ed9..8097561 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, input_set_drvdata(input_dev, ir_dev); rc = input_register_device(input_dev); + if (rc < 0) + goto err; + + rc = ir_register_class(input_dev); if (rc < 0) { - kfree(rc_tab->scan); - kfree(ir_dev); - input_set_drvdata(input_dev, NULL); + input_unregister_device(input_dev); + goto err; } + return 0; + +err: + kfree(rc_tab->scan); + kfree(ir_dev); + input_set_drvdata(input_dev, NULL); return rc; } EXPORT_SYMBOL_GPL(ir_input_register); @@ -472,6 +481,8 @@ void ir_input_unregister(struct input_dev *dev) kfree(rc_tab->scan); rc_tab->scan = NULL; + ir_unregister_class(dev); + kfree(ir_dev); input_unregister_device(dev); } |