aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-input.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-11-29 06:19:59 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:42:21 -0500
commit055cd55601f948675006ca90362fc2bfaae90a86 (patch)
treea878c55c30b0ae30334f3523d8dd67940d32a7f3 /drivers/media/video/bt8xx/bttv-input.c
parent0278155c84af42d78785731263b69fb49f945ea7 (diff)
V4L/DVB (13537): ir: Prepare the code for dynamic keycode table allocation
Currently, the IR table is initialized by calling ir_input_init(). However, this function doesn't return any error code, nor has a function to be called when de-initializing the IR's. Change the return argment to integer and make sure that each driver will handle the error code. Also adds a function to free any resources that may be allocating there: ir_input_free(). Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-input.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c7
1 files changed, 6 insertions, 1 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;