dev_set_drvdata(dev,ir); input_register_device(&ir->input); printk(DEVNAME ": %s detected at %s\n",ir->input.name,ir->input.phys); 
dev_set_drvdata(dev, ir); input_register_device(ir->input); 
static int ir_probe(struct device *dev){	struct bttv_sub_device *sub = to_bttv_sub_dev(dev);	struct IR *ir;	IR_KEYTAB_TYPE *ir_codes = NULL;	int ir_type = IR_TYPE_OTHER;	ir = kmalloc(sizeof(*ir),GFP_KERNEL);	if (NULL == ir)		return -ENOMEM;	memset(ir,0,sizeof(*ir));	/* detect & configure */	switch (sub->core->type) {	case BTTV_AVERMEDIA:	case BTTV_AVPHONE98:	case BTTV_AVERMEDIA98:		ir_codes         = ir_codes_avermedia;		ir->mask_keycode = 0xf88000;		ir->mask_keydown = 0x010000;		ir->polling      = 50; // ms		break;	case BTTV_AVDVBT_761:	case BTTV_AVDVBT_771:		ir_codes         = ir_codes_avermedia_dvbt;		ir->mask_keycode = 0x0f00c0;		ir->mask_keydown = 0x000020;		ir->polling      = 50; // ms		break;	case BTTV_PXELVWPLTVPAK:		ir_codes         = ir_codes_pixelview;		ir->mask_keycode = 0x003e00;		ir->mask_keyup   = 0x010000;		ir->polling      = 50; // ms                break;	case BTTV_PV_BT878P_9B:	case BTTV_PV_BT878P_PLUS:		ir_codes         = ir_codes_pixelview;		ir->mask_keycode = 0x001f00;		ir->mask_keyup   = 0x008000;		ir->polling      = 50; // ms                break;	case BTTV_WINFAST2000:		ir_codes         = ir_codes_winfast;		ir->mask_keycode = 0x1f8;		break;	case BTTV_MAGICTVIEW061:	case BTTV_MAGICTVIEW063:		ir_codes         = ir_codes_winfast;		ir->mask_keycode = 0x0008e000;		ir->mask_keydown = 0x00200000;		break;	case BTTV_APAC_VIEWCOMP:		ir_codes         = ir_codes_apac_viewcomp;		ir->mask_keycode = 0x001f00;		ir->mask_keyup   = 0x008000;		ir->polling      = 50; // ms		break;	}	if (NULL == ir_codes) {		kfree(ir);		return -ENODEV;	}	/* init hardware-specific stuff */	bttv_gpio_inout(sub->core, ir->mask_keycode | ir->mask_keydown, 0);	ir->sub = sub;	/* init input device */	snprintf(ir->name, sizeof(ir->name), "bttv IR (card=%d)",		 sub->core->type);	snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",		 pci_name(sub->core->pci));	ir_input_init(&ir->input, &ir->ir, ir_type, ir_codes);	ir->input.name = ir->name;	ir->input.phys = ir->phys;	ir->input.id.bustype = BUS_PCI;	ir->input.id.version = 1;	if (sub->core->pci->subsystem_vendor) {		ir->input.id.vendor  = sub->core->pci->subsystem_vendor;		ir->input.id.product = sub->core->pci->subsystem_device;	} else {		ir->input.id.vendor  = sub->core->pci->vendor;		ir->input.id.product = sub->core->pci->device;	}	ir->input.dev = &sub->core->pci->dev;	if (ir->polling) {		INIT_WORK(&ir->work, ir_work, ir);		init_timer(&ir->timer);		ir->timer.function = ir_timer;		ir->timer.data     = (unsigned long)ir;		schedule_work(&ir->work);	}	/* all done */	dev_set_drvdata(dev,ir);	input_register_device(&ir->input);	printk(DEVNAME ": %s detected at %s\n",ir->input.name,ir->input.phys);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b7df3910c1298fee8ed7b9dfd2da74b85df5539c/ir-kbd-gpio.c/clean/drivers/media/video/ir-kbd-gpio.c