if (!serio->id.proto || serio->id.proto > SERIO_MZPP) return -ENODEV; 
sermouse = kzalloc(sizeof(struct sermouse), GFP_KERNEL); input_dev = input_allocate_device(); if (!sermouse || !input_dev) goto fail; 
static int sermouse_connect(struct serio *serio, struct serio_driver *drv){	struct sermouse *sermouse;	unsigned char c;	int err;	if (!serio->id.proto || serio->id.proto > SERIO_MZPP)		return -ENODEV;	if (!(sermouse = kmalloc(sizeof(struct sermouse), GFP_KERNEL)))		return -ENOMEM;	memset(sermouse, 0, sizeof(struct sermouse));	init_input_dev(&sermouse->dev);	sermouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);	sermouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);	sermouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);	sermouse->dev.private = sermouse;	sermouse->type = serio->id.proto;	c = serio->id.extra;	if (c & 0x01) set_bit(BTN_MIDDLE, sermouse->dev.keybit);	if (c & 0x02) set_bit(BTN_SIDE, sermouse->dev.keybit);	if (c & 0x04) set_bit(BTN_EXTRA, sermouse->dev.keybit);	if (c & 0x10) set_bit(REL_WHEEL, sermouse->dev.relbit);	if (c & 0x20) set_bit(REL_HWHEEL, sermouse->dev.relbit);	sprintf(sermouse->phys, "%s/input0", serio->phys);	sermouse->dev.name = sermouse_protocols[sermouse->type];	sermouse->dev.phys = sermouse->phys;	sermouse->dev.id.bustype = BUS_RS232;	sermouse->dev.id.vendor = sermouse->type;	sermouse->dev.id.product = c;	sermouse->dev.id.version = 0x0100;	sermouse->dev.dev = &serio->dev;	serio_set_drvdata(serio, sermouse);	err = serio_open(serio, drv);	if (err) {		serio_set_drvdata(serio, NULL);		kfree(sermouse);		return err;	}	input_register_device(&sermouse->dev);	printk(KERN_INFO "input: %s on %s\n", sermouse_protocols[sermouse->type], serio->phys);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2e5b636bb5f8dacbb91d08544e2c41ebcad5dace/sermouse.c/clean/drivers/input/mouse/sermouse.c