diff options
Diffstat (limited to 'drivers/media/dvb/dm1105/dm1105.c')
-rw-r--r-- | drivers/media/dvb/dm1105/dm1105.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c index 2d099e271751..53e3f2a7d31a 100644 --- a/drivers/media/dvb/dm1105/dm1105.c +++ b/drivers/media/dvb/dm1105/dm1105.c | |||
@@ -510,7 +510,7 @@ static void dm1105_emit_key(struct work_struct *work) | |||
510 | 510 | ||
511 | data = (ircom >> 8) & 0x7f; | 511 | data = (ircom >> 8) & 0x7f; |
512 | 512 | ||
513 | ir_input_keydown(ir->input_dev, &ir->ir, data, data); | 513 | ir_input_keydown(ir->input_dev, &ir->ir, data); |
514 | ir_input_nokey(ir->input_dev, &ir->ir); | 514 | ir_input_nokey(ir->input_dev, &ir->ir); |
515 | } | 515 | } |
516 | 516 | ||
@@ -589,7 +589,12 @@ 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 | ir_input_init(input_dev, &dm1105->ir.ir, ir_type, ir_codes); | 592 | err = ir_input_init(input_dev, &dm1105->ir.ir, ir_type, ir_codes); |
593 | if (err < 0) { | ||
594 | input_free_device(input_dev); | ||
595 | return err; | ||
596 | } | ||
597 | |||
593 | input_dev->name = "DVB on-card IR receiver"; | 598 | input_dev->name = "DVB on-card IR receiver"; |
594 | input_dev->phys = dm1105->ir.input_phys; | 599 | input_dev->phys = dm1105->ir.input_phys; |
595 | input_dev->id.bustype = BUS_PCI; | 600 | input_dev->id.bustype = BUS_PCI; |
@@ -608,6 +613,7 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) | |||
608 | 613 | ||
609 | err = input_register_device(input_dev); | 614 | err = input_register_device(input_dev); |
610 | if (err) { | 615 | if (err) { |
616 | ir_input_free(input_dev); | ||
611 | input_free_device(input_dev); | 617 | input_free_device(input_dev); |
612 | return err; | 618 | return err; |
613 | } | 619 | } |
@@ -617,8 +623,8 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105) | |||
617 | 623 | ||
618 | void __devexit dm1105_ir_exit(struct dm1105dvb *dm1105) | 624 | void __devexit dm1105_ir_exit(struct dm1105dvb *dm1105) |
619 | { | 625 | { |
626 | ir_input_free(dm1105->ir.input_dev); | ||
620 | input_unregister_device(dm1105->ir.input_dev); | 627 | input_unregister_device(dm1105->ir.input_dev); |
621 | |||
622 | } | 628 | } |
623 | 629 | ||
624 | static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb) | 630 | static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb) |