diff options
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 9 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_ir.c | 8 |
2 files changed, 9 insertions, 8 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index 06958d966..71bff8b7e 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -2485,14 +2485,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d goto err_av7110_exit_v4l_12; #if defined(CONFIG_INPUT_EVDEV) || defined(CONFIG_INPUT_EVDEV_MODULE) - /* FIXME: this is a hack, just like av7110_setup_irc_config() is */ - { - static int ir_initialized; - if (!ir_initialized) { - av7110_ir_init(); - ++ir_initialized; - } - } + av7110_ir_init(); #endif printk(KERN_INFO "dvb-ttpci: found av7110-%d.\n", av7110_num); av7110_num++; diff --git a/linux/drivers/media/dvb/ttpci/av7110_ir.c b/linux/drivers/media/dvb/ttpci/av7110_ir.c index 10df56b54..e5fa5b08a 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_ir.c +++ b/linux/drivers/media/dvb/ttpci/av7110_ir.c @@ -12,6 +12,7 @@ /* enable ir debugging by or'ing av7110_debug with 16 */ +static int ir_initialized; static struct input_dev input_dev; static u32 ir_config; @@ -160,6 +161,9 @@ static int av7110_ir_write_proc(struct file *file, const char __user *buffer, int __init av7110_ir_init(void) { + if (ir_initialized) + return 0; + static struct proc_dir_entry *e; init_timer(&keyup_timer); @@ -187,16 +191,20 @@ int __init av7110_ir_init(void) e->size = 4 + 256 * sizeof(u16); } + ir_initialized = 1; return 0; } void __exit av7110_ir_exit(void) { + if (ir_initialized == 0) + return; del_timer_sync(&keyup_timer); remove_proc_entry("av7110_ir", NULL); av7110_unregister_irc_handler(av7110_emit_key); input_unregister_device(&input_dev); + ir_initialized = 0; } //MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>"); |