interact->dev.name = interact_type[i].name; interact->dev.phys = interact->phys; interact->dev.id.bustype = BUS_GAMEPORT; interact->dev.id.vendor = GAMEPORT_ID_VENDOR_INTERACT; interact->dev.id.product = interact_type[i].id; interact->dev.id.version = 0x0100; 
input_dev->open = interact_open; input_dev->close = interact_close; 
static int interact_connect(struct gameport *gameport, struct gameport_driver *drv){	struct interact *interact;	__u32 data[3];	int i, t;	int err;	if (!(interact = kzalloc(sizeof(struct interact), GFP_KERNEL)))		return -ENOMEM;	interact->gameport = gameport;	gameport_set_drvdata(gameport, interact);	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);	if (err)		goto fail1;	i = interact_read_packet(gameport, INTERACT_MAX_LENGTH * 2, data);	if (i != 32 || (data[0] >> 24) != 0x0c || (data[1] >> 24) != 0x02) {		err = -ENODEV;		goto fail2;	}	for (i = 0; interact_type[i].length; i++)		if (interact_type[i].id == (data[2] >> 16))			break;	if (!interact_type[i].length) {		printk(KERN_WARNING "interact.c: Unknown joystick on %s. [len %d d0 %08x d1 %08x i2 %08x]\n",			gameport->phys, i, data[0], data[1], data[2]);		err = -ENODEV;		goto fail2;	}	gameport_set_poll_handler(gameport, interact_poll);	gameport_set_poll_interval(gameport, 20);	sprintf(interact->phys, "%s/input0", gameport->phys);	interact->type = i;	interact->length = interact_type[i].length;	interact->dev.private = interact;	interact->dev.open = interact_open;	interact->dev.close = interact_close;	interact->dev.name = interact_type[i].name;	interact->dev.phys = interact->phys;	interact->dev.id.bustype = BUS_GAMEPORT;	interact->dev.id.vendor = GAMEPORT_ID_VENDOR_INTERACT;	interact->dev.id.product = interact_type[i].id;	interact->dev.id.version = 0x0100;	interact->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);	for (i = 0; (t = interact_type[interact->type].abs[i]) >= 0; i++) {		set_bit(t, interact->dev.absbit);		if (i < interact_type[interact->type].b8) {			interact->dev.absmin[t] = 0;			interact->dev.absmax[t] = 255;		} else {			interact->dev.absmin[t] = -1;			interact->dev.absmax[t] = 1;		}	}	for (i = 0; (t = interact_type[interact->type].btn[i]) >= 0; i++)		set_bit(t, interact->dev.keybit);	input_register_device(&interact->dev);	printk(KERN_INFO "input: %s on %s\n",		interact_type[interact->type].name, gameport->phys);	return 0;fail2:	gameport_close(gameport);fail1:  gameport_set_drvdata(gameport, NULL);	kfree(interact);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/17dd3f0f7aa729a042af5d3318ff9b3e7781b45b/interact.c/clean/drivers/input/joystick/interact.c