fail2:	gameport_close(gameport); fail1:	gameport_set_drvdata(gameport, NULL); 
fail3:	for (i = 0; i < 2; i++) if (cobra->dev[i]) input_unregister_device(cobra->dev[i]); fail2:	gameport_close(gameport); fail1:	gameport_set_drvdata(gameport, NULL); 
static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv){	struct cobra *cobra;	unsigned int data[2];	int i, j;	int err;	if (!(cobra = kzalloc(sizeof(struct cobra), GFP_KERNEL)))		return -ENOMEM;	cobra->gameport = gameport;	gameport_set_drvdata(gameport, cobra);	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);	if (err)		goto fail1;	cobra->exists = cobra_read_packet(gameport, data);	for (i = 0; i < 2; i++)		if ((cobra->exists >> i) & data[i] & 1) {			printk(KERN_WARNING "cobra.c: Device %d on %s has the Ext bit set. ID is: %d"				" Contact vojtech@ucw.cz\n", i, gameport->phys, (data[i] >> 2) & 7);			cobra->exists &= ~(1 << i);		}	if (!cobra->exists) {		err = -ENODEV;		goto fail2;	}	gameport_set_poll_handler(gameport, cobra_poll);	gameport_set_poll_interval(gameport, 20);	for (i = 0; i < 2; i++)		if ((cobra->exists >> i) & 1) {			sprintf(cobra->phys[i], "%s/input%d", gameport->phys, i);			cobra->dev[i].private = cobra;			cobra->dev[i].open = cobra_open;			cobra->dev[i].close = cobra_close;			cobra->dev[i].name = cobra_name;			cobra->dev[i].phys = cobra->phys[i];			cobra->dev[i].id.bustype = BUS_GAMEPORT;			cobra->dev[i].id.vendor = GAMEPORT_ID_VENDOR_CREATIVE;			cobra->dev[i].id.product = 0x0008;			cobra->dev[i].id.version = 0x0100;			cobra->dev[i].evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);			input_set_abs_params(&cobra->dev[i], ABS_X, -1, 1, 0, 0);			input_set_abs_params(&cobra->dev[i], ABS_Y, -1, 1, 0, 0);			for (j = 0; cobra_btn[j]; j++)				set_bit(cobra_btn[j], cobra->dev[i].keybit);			input_register_device(&cobra->dev[i]);			printk(KERN_INFO "input: %s on %s\n", cobra_name, gameport->phys);		}	return 0;fail2:	gameport_close(gameport);fail1:	gameport_set_drvdata(gameport, NULL);	kfree(cobra);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/17dd3f0f7aa729a042af5d3318ff9b3e7781b45b/cobra.c/clean/drivers/input/joystick/cobra.c