/* Free a device structure, all reports, and all fields.  */
static void hid_device_release(struct device *dev)
/* Free a device structure, all reports, and all fields.  */
static void hid_device_release(struct device *dev)
{
	struct hid_device *device = container_of(dev, struct hid_device, dev);
	unsigned i, j;
	for (i = 0; i < HID_REPORT_TYPES; i++) {
		struct hid_report_enum *report_enum = device->report_enum + i;
		for (j = 0; j < 256; j++) {
			struct hid_report *report = report_enum->report_id_hash[j];
			if (report)
				hid_free_report(report);
		}
	}
	kfree(device->rdesc);
	kfree(device->collection);
	kfree(device);
}