diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-11 09:20:59 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:18:45 -0500 |
commit | 579e7d60ba0035228aadad69eb2ffeb138c51311 (patch) | |
tree | 0872698fe02dba92cead8e9d9a7ca7e7f38e1291 /drivers/media/dvb/dm1105/dm1105.c | |
parent | 38ef6aa884e3fd389f7d444b8dd36c16832e36b4 (diff) |
V4L/DVB (13617): ir: move input_register_device() to happen inside ir_input_register()
We'll need to register a sysfs class for the IR devices. As such, the better
is to have the input_register_device()/input_unregister_device() inside
the ir register/unregister functions.
Also, solves a naming problem with V4L ir_input_init() function, that were,
in fact, registering a device.
While here, do a few cleanups at budget-ci IR logic.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dm1105/dm1105.c')
-rw-r--r-- | drivers/media/dvb/dm1105/dm1105.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c index 34e4e569cc7d..f0f483ac8b89 100644 --- a/drivers/media/dvb/dm1105/dm1105.c +++ b/drivers/media/dvb/dm1105/dm1105.c | |||
@@ -589,7 +589,7 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) | |||
589 | snprintf(dm1105->ir.input_phys, sizeof(dm1105->ir.input_phys), | 589 | snprintf(dm1105->ir.input_phys, sizeof(dm1105->ir.input_phys), |
590 | "pci-%s/ir0", pci_name(dm1105->pdev)); | 590 | "pci-%s/ir0", pci_name(dm1105->pdev)); |
591 | 591 | ||
592 | err = ir_input_init(input_dev, &dm1105->ir.ir, ir_type, ir_codes); | 592 | err = ir_input_init(input_dev, &dm1105->ir.ir, ir_type); |
593 | if (err < 0) { | 593 | if (err < 0) { |
594 | input_free_device(input_dev); | 594 | input_free_device(input_dev); |
595 | return err; | 595 | return err; |
@@ -611,20 +611,14 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) | |||
611 | 611 | ||
612 | INIT_WORK(&dm1105->ir.work, dm1105_emit_key); | 612 | INIT_WORK(&dm1105->ir.work, dm1105_emit_key); |
613 | 613 | ||
614 | err = input_register_device(input_dev); | 614 | err = ir_input_register(input_dev, ir_codes); |
615 | if (err) { | ||
616 | ir_input_unregister(input_dev); | ||
617 | input_free_device(input_dev); | ||
618 | return err; | ||
619 | } | ||
620 | 615 | ||
621 | return 0; | 616 | return err; |
622 | } | 617 | } |
623 | 618 | ||
624 | void __devexit dm1105_ir_exit(struct dm1105dvb *dm1105) | 619 | void __devexit dm1105_ir_exit(struct dm1105dvb *dm1105) |
625 | { | 620 | { |
626 | ir_input_unregister(dm1105->ir.input_dev); | 621 | ir_input_unregister(dm1105->ir.input_dev); |
627 | input_unregister_device(dm1105->ir.input_dev); | ||
628 | } | 622 | } |
629 | 623 | ||
630 | static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb) | 624 | static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb) |