aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-keytable.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-03-11 10:41:56 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:47:03 -0400
commit945cdfa2c99e2a3f5ead11519ba11ed1df2dd5c1 (patch)
tree0a0a62bca91befd1e607ca6b138df2fd2083fea8 /drivers/media/IR/ir-keytable.c
parent8b0d2a052733d0a0e8ed59aeb8c7e6c90fdb793e (diff)
V4L/DVB: ir: use a real device instead of a virtual class
Change the ir-sysfs approach to create irrcv0 as a device, instead of using class_dev. Also, change the way input is registered, in order to make its parent to be the irrcv device. Due to this change, now the event device is created under /sys/class/ir/irrcv class: /sys/class/irrcv/irrcv0/ |-- current_protocol |-- device -> ../../../1-3 |-- input9 | |-- capabilities | | |-- abs ... 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.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index bfca26d51827..af1f4d7fb910 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -449,22 +449,15 @@ int ir_input_register(struct input_dev *input_dev,
449 input_dev->setkeycode = ir_setkeycode; 449 input_dev->setkeycode = ir_setkeycode;
450 input_set_drvdata(input_dev, ir_dev); 450 input_set_drvdata(input_dev, ir_dev);
451 451
452 rc = input_register_device(input_dev);
453 if (rc < 0)
454 goto err;
455
456 rc = ir_register_class(input_dev); 452 rc = ir_register_class(input_dev);
457 if (rc < 0) { 453 if (rc < 0)
458 input_unregister_device(input_dev);
459 goto err; 454 goto err;
460 }
461 455
462 return 0; 456 return 0;
463 457
464err: 458err:
465 kfree(rc_tab->scan); 459 kfree(rc_tab->scan);
466 kfree(ir_dev); 460 kfree(ir_dev);
467 input_set_drvdata(input_dev, NULL);
468 return rc; 461 return rc;
469} 462}
470EXPORT_SYMBOL_GPL(ir_input_register); 463EXPORT_SYMBOL_GPL(ir_input_register);
@@ -493,7 +486,6 @@ void ir_input_unregister(struct input_dev *dev)
493 ir_unregister_class(dev); 486 ir_unregister_class(dev);
494 487
495 kfree(ir_dev); 488 kfree(ir_dev);
496 input_unregister_device(dev);
497} 489}
498EXPORT_SYMBOL_GPL(ir_input_unregister); 490EXPORT_SYMBOL_GPL(ir_input_unregister);
499 491