diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c index 6db3ff74659b54acb6476469f5462a8201a9ddf3..73fe4bec83bc8124b894715a91644bd9be0c0b42 100644 --- a/drivers/media/IR/ir-keytable.c +++ b/drivers/media/IR/ir-keytable.c @@ -404,7 +404,8 @@ EXPORT_SYMBOL_GPL(ir_g_keycode_from_table); */ int ir_input_register(struct input_dev *input_dev, const struct ir_scancode_table *rc_tab, - const struct ir_dev_props *props) + const struct ir_dev_props *props, + const char *driver_name) { struct ir_input_dev *ir_dev; struct ir_scancode *keymap = rc_tab->scan; @@ -419,6 +420,10 @@ int ir_input_register(struct input_dev *input_dev, spin_lock_init(&ir_dev->rc_tab.lock); + ir_dev->driver_name = kmalloc(strlen(driver_name) + 1, GFP_KERNEL); + if (!ir_dev->driver_name) + return -ENOMEM; + strcpy(ir_dev->driver_name, driver_name); ir_dev->rc_tab.name = rc_tab->name; ir_dev->rc_tab.size = ir_roundup_tablesize(rc_tab->size); ir_dev->rc_tab.scan = kzalloc(ir_dev->rc_tab.size * diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c index 6d63657b5685384b7d4e66ad4e91eacc0335d58f..0592515a19f8b561a420ba8517c5eeefedc82b6a 100644 --- a/drivers/media/IR/ir-sysfs.c +++ b/drivers/media/IR/ir-sysfs.c @@ -140,6 +140,8 @@ static int ir_dev_uevent(struct device *device, struct kobj_uevent_env *env) if (ir_dev->rc_tab.name) ADD_HOTPLUG_VAR("NAME=\"%s\"", ir_dev->rc_tab.name); + if (ir_dev->driver_name) + ADD_HOTPLUG_VAR("DRV_NAME=\"%s\"", ir_dev->driver_name); return 0; } diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c index b6d46961a99e8726954f4adb2381e59fa05d60a3..3229ff325c5699864f020f90b6d1f55700a52449 100644 --- a/drivers/media/dvb/dm1105/dm1105.c +++ b/drivers/media/dvb/dm1105/dm1105.c @@ -46,6 +46,8 @@ #include "z0194a.h" #include "ds3000.h" +#define MODULE_NAME "dm1105" + #define UNSET (-1U) #define DM1105_BOARD_NOAUTO UNSET @@ -628,7 +630,7 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) INIT_WORK(&dm1105->ir.work, dm1105_emit_key); - err = ir_input_register(input_dev, ir_codes, NULL); + err = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); return err; } diff --git a/drivers/media/dvb/mantis/mantis_input.c b/drivers/media/dvb/mantis/mantis_input.c index 4675a3b53c7d13812f9d8f2ed1c4201071542d17..6baf3022968910da4d28ed0eaefa2a109dfc07c8 100644 --- a/drivers/media/dvb/mantis/mantis_input.c +++ b/drivers/media/dvb/mantis/mantis_input.c @@ -32,6 +32,8 @@ #include "mantis_reg.h" #include "mantis_uart.h" +#define MODULE_NAME "mantis_core" + static struct ir_scancode mantis_ir_table[] = { { 0x29, KEY_POWER }, { 0x28, KEY_FAVORITES }, @@ -126,7 +128,7 @@ int mantis_input_init(struct mantis_pci *mantis) rc->id.version = 1; rc->dev = mantis->pdev->dev; - err = ir_input_register(rc, &ir_mantis, NULL); + err = ir_input_register(rc, &ir_mantis, NULL, MODULE_NAME); if (err) { dprintk(MANTIS_ERROR, 1, "IR device registration failed, ret = %d", err); input_free_device(rc); diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 49c2a817a06f76a4d7eb10ef7a84a0b4e91e05dd..ec89afd38917d8a60762660d5bcfa728e4faa874 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -54,6 +54,8 @@ #include "tda1002x.h" #include "tda827x.h" +#define MODULE_NAME "budget_ci" + /* * Regarding DEBIADDR_IR: * Some CI modules hang if random addresses are read. @@ -254,7 +256,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) budget_ci->ir.timer_keyup.function = msp430_ir_keyup; budget_ci->ir.timer_keyup.data = (unsigned long) &budget_ci->ir; budget_ci->ir.last_raw = 0xffff; /* An impossible value */ - error = ir_input_register(input_dev, ir_codes, NULL); + error = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); if (error) { printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error); return error; diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c index aa153a986ade3e7e264ab27815dd71db0538af18..d17a9b7911e5443633dd8e176b3a80cb37d23f25 100644 --- a/drivers/media/video/bt8xx/bttv-input.c +++ b/drivers/media/video/bt8xx/bttv-input.c @@ -49,6 +49,8 @@ module_param(ir_rc5_key_timeout, int, 0644); #define DEVNAME "bttv-input" +#define MODULE_NAME "bttv" + /* ---------------------------------------------------------------------- */ static void ir_handle_key(struct bttv *btv) @@ -390,7 +392,7 @@ int bttv_input_init(struct bttv *btv) bttv_ir_start(btv, ir); /* all done */ - err = ir_input_register(btv->remote->dev, ir_codes, NULL); + err = ir_input_register(btv->remote->dev, ir_codes, NULL, MODULE_NAME); if (err) goto err_out_stop; diff --git a/drivers/media/video/cx231xx/cx231xx-input.c b/drivers/media/video/cx231xx/cx231xx-input.c index b473cd8367f59ba170de3b76d187cd725c0a297f..a0e8bb88d67e5dbfa44a79b4c6065ab654e93194 100644 --- a/drivers/media/video/cx231xx/cx231xx-input.c +++ b/drivers/media/video/cx231xx/cx231xx-input.c @@ -35,6 +35,8 @@ static unsigned int ir_debug; module_param(ir_debug, int, 0644); MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); +#define MODULE_NAME "cx231xx" + #define i2cdprintk(fmt, arg...) \ if (ir_debug) { \ printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg); \ @@ -217,7 +219,8 @@ int cx231xx_ir_init(struct cx231xx *dev) cx231xx_ir_start(ir); /* all done */ - err = ir_input_register(ir->input, dev->board.ir_codes, NULL); + err = ir_input_register(ir->input, dev->board.ir_codes, + NULL, MODULE_NAME); if (err) goto err_out_stop; diff --git a/drivers/media/video/cx23885/cx23885-input.c b/drivers/media/video/cx23885/cx23885-input.c index 8e9d990dbe9385b223fa5c3d95e1dff5c2a54ecc..ef1db2d9668aeb04ab316a85b7a1b3b547b8f0d0 100644 --- a/drivers/media/video/cx23885/cx23885-input.c +++ b/drivers/media/video/cx23885/cx23885-input.c @@ -51,6 +51,8 @@ #define RC5_EXTENDED_COMMAND_OFFSET 64 +#define MODULE_NAME "cx23885" + static inline unsigned int rc5_command(u32 rc5_baseband) { return RC5_INSTR(rc5_baseband) + @@ -398,7 +400,7 @@ int cx23885_input_init(struct cx23885_dev *dev) dev->ir_input = ir; cx23885_input_ir_start(dev); - ret = ir_input_register(ir->dev, ir_codes, NULL); + ret = ir_input_register(ir->dev, ir_codes, NULL, MODULE_NAME); if (ret) goto err_out_stop; diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 6b6abf062c21bd7c08f9fedefd751526b54fbf46..8b52546c6e1d787eb1bae9829d273166f1e4745f 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c @@ -32,6 +32,8 @@ #include "cx88.h" #include +#define MODULE_NAME "cx88xx" + /* ---------------------------------------------------------------------- */ struct cx88_IR { @@ -384,7 +386,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) cx88_ir_start(core, ir); /* all done */ - err = ir_input_register(ir->input, ir_codes, NULL); + err = ir_input_register(ir->input, ir_codes, NULL, MODULE_NAME); if (err) goto err_out_stop; diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index 20a0001e88850c97e3f1282eeb82f1700a5b5d32..32f376654c0c53bfcfaf4238765549a339c3a705 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c @@ -39,6 +39,8 @@ static unsigned int ir_debug; module_param(ir_debug, int, 0644); MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); +#define MODULE_NAME "em28xx" + #define i2cdprintk(fmt, arg...) \ if (ir_debug) { \ printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg); \ @@ -474,7 +476,7 @@ int em28xx_ir_init(struct em28xx *dev) /* all done */ err = ir_input_register(ir->input, dev->board.ir_codes, - &ir->props); + &ir->props, MODULE_NAME); if (err) goto err_out_stop; diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index da18d698e7f2b10ea61983b0ca57acafa0386d57..6af69d5c84990625f7e1ec53a13e3341b195f563 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c @@ -61,9 +61,9 @@ module_param(hauppauge, int, 0644); /* Choose Hauppauge remote */ MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)"); -#define DEVNAME "ir-kbd-i2c" +#define MODULE_NAME "ir-kbd-i2c" #define dprintk(level, fmt, arg...) if (debug >= level) \ - printk(KERN_DEBUG DEVNAME ": " fmt , ## arg) + printk(KERN_DEBUG MODULE_NAME ": " fmt , ## arg) /* ----------------------------------------------------------------------- */ @@ -447,11 +447,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) input_dev->name = ir->name; input_dev->phys = ir->phys; - err = ir_input_register(ir->input, ir->ir_codes, NULL); + err = ir_input_register(ir->input, ir->ir_codes, NULL, MODULE_NAME); if (err) goto err_out_free; - printk(DEVNAME ": %s detected at %s [%s]\n", + printk(MODULE_NAME ": %s detected at %s [%s]\n", ir->input->name, ir->input->phys, adap->name); /* start polling via eventd */ diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index a2b16693ee9a6ac493b42fbc6194ebc12eecbfe7..c1fe7c9369b2881ac52f922a89c88d8c143b93a1 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c @@ -28,6 +28,8 @@ #include "saa7134-reg.h" #include "saa7134.h" +#define MODULE_NAME "saa7134" + static unsigned int disable_ir; module_param(disable_ir, int, 0444); MODULE_PARM_DESC(disable_ir,"disable infrared remote support"); @@ -730,7 +732,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) dev->remote = ir; saa7134_ir_start(dev, ir); - err = ir_input_register(ir->dev, ir_codes, NULL); + err = ir_input_register(ir->dev, ir_codes, NULL, MODULE_NAME); if (err) goto err_out_stop; diff --git a/include/media/ir-core.h b/include/media/ir-core.h index 9ab8a7774223b9d94c48b5ebf498bbf6ddf50344..1eae72d518e01868f54ad6692c0787bf161eed49 100644 --- a/include/media/ir-core.h +++ b/include/media/ir-core.h @@ -49,6 +49,7 @@ struct ir_dev_props { struct ir_input_dev { struct device dev; /* device */ + char *driver_name; /* Name of the driver module */ struct ir_scancode_table rc_tab; /* scan/key table */ unsigned long devno; /* device number */ const struct ir_dev_props *props; /* Device properties */ @@ -62,7 +63,8 @@ u32 ir_g_keycode_from_table(struct input_dev *input_dev, int ir_input_register(struct input_dev *dev, const struct ir_scancode_table *ir_codes, - const struct ir_dev_props *props); + const struct ir_dev_props *props, + const char *driver_name); void ir_input_unregister(struct input_dev *input_dev); /* Routines from ir-sysfs.c */