memset(ir,0,sizeof(*ir)); 
}  
static int ir_attach(struct i2c_adapter *adap, int addr,		     unsigned short flags, int kind){	IR_KEYTAB_TYPE *ir_codes = NULL;	char *name;	int ir_type;        struct IR *ir;        if (NULL == (ir = kmalloc(sizeof(struct IR),GFP_KERNEL)))                return -ENOMEM;	memset(ir,0,sizeof(*ir));	ir->c = client_template;	i2c_set_clientdata(&ir->c, ir);	ir->c.adapter = adap;	ir->c.addr    = addr;	switch(addr) {	case 0x64:		name        = "Pixelview";		ir->get_key = get_key_pixelview;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_empty;		break;	case 0x4b:		name        = "PV951";		ir->get_key = get_key_pv951;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_pv951;		break;	case 0x18:	case 0x1a:		name        = "Hauppauge";		ir->get_key = get_key_haup;		ir_type     = IR_TYPE_RC5;		ir_codes    = ir_codes_rc5_tv;		break;	case 0x30:		name        = "KNC One";		ir->get_key = get_key_knc1;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_empty;		break;	case 0x7a:		name        = "Purple TV";		ir->get_key = get_key_purpletv;		ir_type     = IR_TYPE_OTHER;		ir_codes    = ir_codes_purpletv;		break;	default:		/* shouldn't happen */		printk(DEVNAME ": Huh? unknown i2c address (0x%02x)?\n",addr);		kfree(ir);		return -1;	}	/* register i2c device */	i2c_attach_client(&ir->c);	snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (%s)", name);	snprintf(ir->phys, sizeof(ir->phys), "%s/%s/ir0",		 ir->c.adapter->dev.bus_id,		 ir->c.dev.bus_id);	/* init + register input device */	ir_input_init(&ir->input,&ir->ir,ir_type,ir_codes);	ir->input.id.bustype = BUS_I2C;	ir->input.name       = ir->c.name;	ir->input.phys       = ir->phys;	input_register_device(&ir->input);	printk(DEVNAME ": %s detected at %s [%s]\n",	       ir->input.name,ir->input.phys,adap->name);	/* start polling via eventd */	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);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b7df3910c1298fee8ed7b9dfd2da74b85df5539c/ir-kbd-i2c.c/clean/drivers/media/video/ir-kbd-i2c.c