psmouse->private = priv = kmalloc(sizeof(struct alps_data), GFP_KERNEL); if (!priv) 
psmouse->private = priv = kzalloc(sizeof(struct alps_data), GFP_KERNEL); dev2 = input_allocate_device(); if (!priv || !dev2) 
int alps_init(struct psmouse *psmouse){	struct alps_data *priv;	int version;	psmouse->private = priv = kmalloc(sizeof(struct alps_data), GFP_KERNEL);	if (!priv)		goto init_fail;	memset(priv, 0, sizeof(struct alps_data));	if (!(priv->i = alps_get_model(psmouse, &version)))		goto init_fail;	if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1))		goto init_fail;	if (alps_tap_mode(psmouse, 1))		printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n");	if (alps_absolute_mode(psmouse)) {		printk(KERN_ERR "alps.c: Failed to enable absolute mode\n");		goto init_fail;	}	if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0))		goto init_fail;	psmouse->dev.evbit[LONG(EV_KEY)] |= BIT(EV_KEY);	psmouse->dev.keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);	psmouse->dev.keybit[LONG(BTN_TOOL_FINGER)] |= BIT(BTN_TOOL_FINGER);	psmouse->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);	psmouse->dev.evbit[LONG(EV_ABS)] |= BIT(EV_ABS);	input_set_abs_params(&psmouse->dev, ABS_X, 0, 1023, 0, 0);	input_set_abs_params(&psmouse->dev, ABS_Y, 0, 767, 0, 0);	input_set_abs_params(&psmouse->dev, ABS_PRESSURE, 0, 127, 0, 0);	if (priv->i->flags & ALPS_WHEEL) {		psmouse->dev.evbit[LONG(EV_REL)] |= BIT(EV_REL);		psmouse->dev.relbit[LONG(REL_WHEEL)] |= BIT(REL_WHEEL);	}	if (priv->i->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) {		psmouse->dev.keybit[LONG(BTN_FORWARD)] |= BIT(BTN_FORWARD);		psmouse->dev.keybit[LONG(BTN_BACK)] |= BIT(BTN_BACK);	}	sprintf(priv->phys, "%s/input1", psmouse->ps2dev.serio->phys);	priv->dev2.phys = priv->phys;	priv->dev2.name = (priv->i->flags & ALPS_DUALPOINT) ? "DualPoint Stick" : "PS/2 Mouse";	priv->dev2.id.bustype = BUS_I8042;	priv->dev2.id.vendor = 0x0002;	priv->dev2.id.product = PSMOUSE_ALPS;	priv->dev2.id.version = 0x0000;	priv->dev2.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);	priv->dev2.relbit[LONG(REL_X)] |= BIT(REL_X) | BIT(REL_Y);	priv->dev2.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);	input_register_device(&priv->dev2);	printk(KERN_INFO "input: %s on %s\n", priv->dev2.name, psmouse->ps2dev.serio->phys);	psmouse->protocol_handler = alps_process_byte;	psmouse->disconnect = alps_disconnect;	psmouse->reconnect = alps_reconnect;	psmouse->pktsize = 6;	return 0;init_fail:	kfree(priv);	return -1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2e5b636bb5f8dacbb91d08544e2c41ebcad5dace/alps.c/buggy/drivers/input/mouse/alps.c