int hidinput_connect(struct hid_device *hid){	struct usb_device *dev = hid->dev;	struct hid_report *report;	struct hid_input *hidinput = NULL;	int i, j, k;	INIT_LIST_HEAD(&hid->inputs);	for (i = 0; i < hid->maxcollection; i++)		if (hid->collection[i].type == HID_COLLECTION_APPLICATION ||		    hid->collection[i].type == HID_COLLECTION_PHYSICAL)		    	if (IS_INPUT_APPLICATION(hid->collection[i].usage))				break;	if (i == hid->maxcollection)		return -1;	for (k = HID_INPUT_REPORT; k <= HID_OUTPUT_REPORT; k++)		list_for_each_entry(report, &hid->report_enum[k].report_list, list) {			if (!report->maxfield)				continue;			if (!hidinput) {				hidinput = kmalloc(sizeof(*hidinput), GFP_KERNEL);				if (!hidinput) {					err("Out of memory during hid input probe");					return -1;				}				memset(hidinput, 0, sizeof(*hidinput));				list_add_tail(&hidinput->list, &hid->inputs);				hidinput->input.private = hid;				hidinput->input.event = hidinput_input_event;				hidinput->input.open = hidinput_open;				hidinput->input.close = hidinput_close;				hidinput->input.name = hid->name;				hidinput->input.phys = hid->phys;				hidinput->input.uniq = hid->uniq;				hidinput->input.id.bustype = BUS_USB;				hidinput->input.id.vendor = le16_to_cpu(dev->descriptor.idVendor);				hidinput->input.id.product = le16_to_cpu(dev->descriptor.idProduct);				hidinput->input.id.version = le16_to_cpu(dev->descriptor.bcdDevice);				hidinput->input.dev = &hid->intf->dev;			}			for (i = 0; i < report->maxfield; i++)				for (j = 0; j < report->field[i]->maxusage; j++)					hidinput_configure_usage(hidinput, report->field[i],								 report->field[i]->usage + j);						if (hid->quirks & HID_QUIRK_MULTI_INPUT) {				/* This will leave hidinput NULL, so that it				 * allocates another one if we have more inputs on				 * the same interface. Some devices (e.g. Happ's				 * UGCI) cram a lot of unrelated inputs into the				 * same interface. */				hidinput->report = report;				input_register_device(&hidinput->input);				hidinput = NULL;			}		}	/* This only gets called when we are a single-input (most of the	 * time). IOW, not a HID_QUIRK_MULTI_INPUT. The hid_ff_init() is	 * only useful in this case, and not for multi-input quirks. */	if (hidinput) {		hid_ff_init(hid);		input_register_device(&hidinput->input);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/05f091ab4c8c1f12f8dd38ee789489904fea327d/hid-input.c/buggy/drivers/usb/input/hid-input.c