aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c7
-rw-r--r--drivers/media/video/cx231xx/cx231xx-input.c8
-rw-r--r--drivers/media/video/cx23885/cx23885-input.c7
-rw-r--r--drivers/media/video/cx88/cx88-input.c7
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c8
-rw-r--r--drivers/media/video/ir-kbd-i2c.c7
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c7
7 files changed, 44 insertions, 7 deletions
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index 62408ccf34c8..84a957e52c4b 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -368,7 +368,10 @@ int bttv_input_init(struct bttv *btv)
368 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", 368 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
369 pci_name(btv->c.pci)); 369 pci_name(btv->c.pci));
370 370
371 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); 371 err = ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
372 if (err < 0)
373 goto err_out_free;
374
372 input_dev->name = ir->name; 375 input_dev->name = ir->name;
373 input_dev->phys = ir->phys; 376 input_dev->phys = ir->phys;
374 input_dev->id.bustype = BUS_PCI; 377 input_dev->id.bustype = BUS_PCI;
@@ -400,6 +403,7 @@ int bttv_input_init(struct bttv *btv)
400 bttv_ir_stop(btv); 403 bttv_ir_stop(btv);
401 btv->remote = NULL; 404 btv->remote = NULL;
402 err_out_free: 405 err_out_free:
406 ir_input_free(input_dev);
403 input_free_device(input_dev); 407 input_free_device(input_dev);
404 kfree(ir); 408 kfree(ir);
405 return err; 409 return err;
@@ -411,6 +415,7 @@ void bttv_input_fini(struct bttv *btv)
411 return; 415 return;
412 416
413 bttv_ir_stop(btv); 417 bttv_ir_stop(btv);
418 ir_input_free(btv->remote->dev);
414 input_unregister_device(btv->remote->dev); 419 input_unregister_device(btv->remote->dev);
415 kfree(btv->remote); 420 kfree(btv->remote);
416 btv->remote = NULL; 421 btv->remote = NULL;
diff --git a/drivers/media/video/cx231xx/cx231xx-input.c b/drivers/media/video/cx231xx/cx231xx-input.c
index 58dd39bc6787..cd135f01b9c1 100644
--- a/drivers/media/video/cx231xx/cx231xx-input.c
+++ b/drivers/media/video/cx231xx/cx231xx-input.c
@@ -197,7 +197,11 @@ int cx231xx_ir_init(struct cx231xx *dev)
197 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); 197 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
198 strlcat(ir->phys, "/input0", sizeof(ir->phys)); 198 strlcat(ir->phys, "/input0", sizeof(ir->phys));
199 199
200 ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER, dev->board.ir_codes); 200 err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER,
201 dev->board.ir_codes);
202 if (err < 0)
203 goto err_out_free;
204
201 input_dev->name = ir->name; 205 input_dev->name = ir->name;
202 input_dev->phys = ir->phys; 206 input_dev->phys = ir->phys;
203 input_dev->id.bustype = BUS_USB; 207 input_dev->id.bustype = BUS_USB;
@@ -222,6 +226,7 @@ err_out_stop:
222 cx231xx_ir_stop(ir); 226 cx231xx_ir_stop(ir);
223 dev->ir = NULL; 227 dev->ir = NULL;
224err_out_free: 228err_out_free:
229 ir_input_free(input_dev);
225 input_free_device(input_dev); 230 input_free_device(input_dev);
226 kfree(ir); 231 kfree(ir);
227 return err; 232 return err;
@@ -236,6 +241,7 @@ int cx231xx_ir_fini(struct cx231xx *dev)
236 return 0; 241 return 0;
237 242
238 cx231xx_ir_stop(ir); 243 cx231xx_ir_stop(ir);
244 ir_input_free(ir->input);
239 input_unregister_device(ir->input); 245 input_unregister_device(ir->input);
240 kfree(ir); 246 kfree(ir);
241 247
diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c
index fea882d1fbcb..469e083dd5f8 100644
--- a/drivers/media/video/cx23885/cx23885-input.c
+++ b/drivers/media/video/cx23885/cx23885-input.c
@@ -377,7 +377,10 @@ int cx23885_input_init(struct cx23885_dev *dev)
377 cx23885_boards[dev->board].name); 377 cx23885_boards[dev->board].name);
378 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(dev->pci)); 378 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(dev->pci));
379 379
380 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); 380 ret = ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
381 if (ret < 0)
382 goto err_out_free;
383
381 input_dev->name = ir->name; 384 input_dev->name = ir->name;
382 input_dev->phys = ir->phys; 385 input_dev->phys = ir->phys;
383 input_dev->id.bustype = BUS_PCI; 386 input_dev->id.bustype = BUS_PCI;
@@ -404,6 +407,7 @@ err_out_stop:
404 cx23885_input_ir_stop(dev); 407 cx23885_input_ir_stop(dev);
405 dev->ir_input = NULL; 408 dev->ir_input = NULL;
406err_out_free: 409err_out_free:
410 ir_input_free(input_dev);
407 input_free_device(input_dev); 411 input_free_device(input_dev);
408 kfree(ir); 412 kfree(ir);
409 return ret; 413 return ret;
@@ -416,6 +420,7 @@ void cx23885_input_fini(struct cx23885_dev *dev)
416 420
417 if (dev->ir_input == NULL) 421 if (dev->ir_input == NULL)
418 return; 422 return;
423 ir_input_free(dev->ir_input->dev);
419 input_unregister_device(dev->ir_input->dev); 424 input_unregister_device(dev->ir_input->dev);
420 kfree(dev->ir_input); 425 kfree(dev->ir_input);
421 dev->ir_input = NULL; 426 dev->ir_input = NULL;
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index 7b2066415d7e..92b8cdf9fb81 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -360,7 +360,10 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
360 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name); 360 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name);
361 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci)); 361 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
362 362
363 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); 363 err = ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
364 if (err < 0)
365 goto err_out_free;
366
364 input_dev->name = ir->name; 367 input_dev->name = ir->name;
365 input_dev->phys = ir->phys; 368 input_dev->phys = ir->phys;
366 input_dev->id.bustype = BUS_PCI; 369 input_dev->id.bustype = BUS_PCI;
@@ -390,6 +393,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
390 cx88_ir_stop(core, ir); 393 cx88_ir_stop(core, ir);
391 core->ir = NULL; 394 core->ir = NULL;
392 err_out_free: 395 err_out_free:
396 ir_input_free(input_dev);
393 input_free_device(input_dev); 397 input_free_device(input_dev);
394 kfree(ir); 398 kfree(ir);
395 return err; 399 return err;
@@ -404,6 +408,7 @@ int cx88_ir_fini(struct cx88_core *core)
404 return 0; 408 return 0;
405 409
406 cx88_ir_stop(core, ir); 410 cx88_ir_stop(core, ir);
411 ir_input_free(ir->input);
407 input_unregister_device(ir->input); 412 input_unregister_device(ir->input);
408 kfree(ir); 413 kfree(ir);
409 414
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 5550de9c669f..d96ec7c09dca 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -367,7 +367,11 @@ int em28xx_ir_init(struct em28xx *dev)
367 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); 367 usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
368 strlcat(ir->phys, "/input0", sizeof(ir->phys)); 368 strlcat(ir->phys, "/input0", sizeof(ir->phys));
369 369
370 ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER, dev->board.ir_codes); 370 err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER,
371 dev->board.ir_codes);
372 if (err < 0)
373 goto err_out_free;
374
371 input_dev->name = ir->name; 375 input_dev->name = ir->name;
372 input_dev->phys = ir->phys; 376 input_dev->phys = ir->phys;
373 input_dev->id.bustype = BUS_USB; 377 input_dev->id.bustype = BUS_USB;
@@ -392,6 +396,7 @@ int em28xx_ir_init(struct em28xx *dev)
392 em28xx_ir_stop(ir); 396 em28xx_ir_stop(ir);
393 dev->ir = NULL; 397 dev->ir = NULL;
394 err_out_free: 398 err_out_free:
399 ir_input_free(input_dev);
395 input_free_device(input_dev); 400 input_free_device(input_dev);
396 kfree(ir); 401 kfree(ir);
397 return err; 402 return err;
@@ -406,6 +411,7 @@ int em28xx_ir_fini(struct em28xx *dev)
406 return 0; 411 return 0;
407 412
408 em28xx_ir_stop(ir); 413 em28xx_ir_stop(ir);
414 ir_input_free(ir->input);
409 input_unregister_device(ir->input); 415 input_unregister_device(ir->input);
410 kfree(ir); 416 kfree(ir);
411 417
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 9c6d0ae58b1f..64360d26b32d 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -437,7 +437,10 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
437 dev_name(&client->dev)); 437 dev_name(&client->dev));
438 438
439 /* init + register input device */ 439 /* init + register input device */
440 ir_input_init(input_dev, &ir->ir, ir_type, ir->ir_codes); 440 err = ir_input_init(input_dev, &ir->ir, ir_type, ir->ir_codes);
441 if (err < 0)
442 goto err_out_free;
443
441 input_dev->id.bustype = BUS_I2C; 444 input_dev->id.bustype = BUS_I2C;
442 input_dev->name = ir->name; 445 input_dev->name = ir->name;
443 input_dev->phys = ir->phys; 446 input_dev->phys = ir->phys;
@@ -456,6 +459,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
456 return 0; 459 return 0;
457 460
458 err_out_free: 461 err_out_free:
462 ir_input_free(input_dev);
459 input_free_device(input_dev); 463 input_free_device(input_dev);
460 kfree(ir); 464 kfree(ir);
461 return err; 465 return err;
@@ -469,6 +473,7 @@ static int ir_remove(struct i2c_client *client)
469 cancel_delayed_work_sync(&ir->work); 473 cancel_delayed_work_sync(&ir->work);
470 474
471 /* unregister device */ 475 /* unregister device */
476 ir_input_free(ir->input);
472 input_unregister_device(ir->input); 477 input_unregister_device(ir->input);
473 478
474 /* free memory */ 479 /* free memory */
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index 439f3d54d009..744918b1cd47 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -652,7 +652,10 @@ int saa7134_input_init1(struct saa7134_dev *dev)
652 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", 652 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
653 pci_name(dev->pci)); 653 pci_name(dev->pci));
654 654
655 ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); 655 err = ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
656 if (err < 0)
657 goto err_out_free;
658
656 input_dev->name = ir->name; 659 input_dev->name = ir->name;
657 input_dev->phys = ir->phys; 660 input_dev->phys = ir->phys;
658 input_dev->id.bustype = BUS_PCI; 661 input_dev->id.bustype = BUS_PCI;
@@ -683,6 +686,7 @@ int saa7134_input_init1(struct saa7134_dev *dev)
683 saa7134_ir_stop(dev); 686 saa7134_ir_stop(dev);
684 dev->remote = NULL; 687 dev->remote = NULL;
685 err_out_free: 688 err_out_free:
689 ir_input_free(input_dev);
686 input_free_device(input_dev); 690 input_free_device(input_dev);
687 kfree(ir); 691 kfree(ir);
688 return err; 692 return err;
@@ -694,6 +698,7 @@ void saa7134_input_fini(struct saa7134_dev *dev)
694 return; 698 return;
695 699
696 saa7134_ir_stop(dev); 700 saa7134_ir_stop(dev);
701 ir_input_free(dev->remote->dev);
697 input_unregister_device(dev->remote->dev); 702 input_unregister_device(dev->remote->dev);
698 kfree(dev->remote); 703 kfree(dev->remote);
699 dev->remote = NULL; 704 dev->remote = NULL;