aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dm1105/dm1105.c10
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c14
2 files changed, 19 insertions, 5 deletions
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c
index 4c28632f94c..53e3f2a7d31 100644
--- a/drivers/media/dvb/dm1105/dm1105.c
+++ b/drivers/media/dvb/dm1105/dm1105.c
@@ -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
618void __devexit dm1105_ir_exit(struct dm1105dvb *dm1105) 624void __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
624static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb) 630static int __devinit dm1105dvb_hw_init(struct dm1105dvb *dm1105dvb)
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index adc4b954e5a..7d193ebc0ae 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -224,8 +224,10 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
224 case 0x1011: 224 case 0x1011:
225 case 0x1012: 225 case 0x1012:
226 /* The hauppauge keymap is a superset of these remotes */ 226 /* The hauppauge keymap is a superset of these remotes */
227 ir_input_init(input_dev, &budget_ci->ir.state, 227 error = ir_input_init(input_dev, &budget_ci->ir.state,
228 IR_TYPE_RC5, &ir_codes_hauppauge_new_table); 228 IR_TYPE_RC5, &ir_codes_hauppauge_new_table);
229 if (error < 0)
230 goto out2;
229 231
230 if (rc5_device < 0) 232 if (rc5_device < 0)
231 budget_ci->ir.rc5_device = 0x1f; 233 budget_ci->ir.rc5_device = 0x1f;
@@ -236,8 +238,10 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
236 case 0x1017: 238 case 0x1017:
237 case 0x101a: 239 case 0x101a:
238 /* for the Technotrend 1500 bundled remote */ 240 /* for the Technotrend 1500 bundled remote */
239 ir_input_init(input_dev, &budget_ci->ir.state, 241 error = ir_input_init(input_dev, &budget_ci->ir.state,
240 IR_TYPE_RC5, &ir_codes_tt_1500_table); 242 IR_TYPE_RC5, &ir_codes_tt_1500_table);
243 if (error < 0)
244 goto out2;
241 245
242 if (rc5_device < 0) 246 if (rc5_device < 0)
243 budget_ci->ir.rc5_device = IR_DEVICE_ANY; 247 budget_ci->ir.rc5_device = IR_DEVICE_ANY;
@@ -246,8 +250,10 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
246 break; 250 break;
247 default: 251 default:
248 /* unknown remote */ 252 /* unknown remote */
249 ir_input_init(input_dev, &budget_ci->ir.state, 253 error = ir_input_init(input_dev, &budget_ci->ir.state,
250 IR_TYPE_RC5, &ir_codes_budget_ci_old_table); 254 IR_TYPE_RC5, &ir_codes_budget_ci_old_table);
255 if (error < 0)
256 goto out2;
251 257
252 if (rc5_device < 0) 258 if (rc5_device < 0)
253 budget_ci->ir.rc5_device = IR_DEVICE_ANY; 259 budget_ci->ir.rc5_device = IR_DEVICE_ANY;
@@ -280,6 +286,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
280 return 0; 286 return 0;
281 287
282out2: 288out2:
289 ir_input_free(input_dev);
283 input_free_device(input_dev); 290 input_free_device(input_dev);
284out1: 291out1:
285 return error; 292 return error;
@@ -297,6 +304,7 @@ static void msp430_ir_deinit(struct budget_ci *budget_ci)
297 del_timer_sync(&dev->timer); 304 del_timer_sync(&dev->timer);
298 ir_input_nokey(dev, &budget_ci->ir.state); 305 ir_input_nokey(dev, &budget_ci->ir.state);
299 306
307 ir_input_free(dev);
300 input_unregister_device(dev); 308 input_unregister_device(dev);
301} 309}
302 310