/* Find a field with a specific usage within a report  */
static struct hid_field* pidff_find_special_field(struct hid_report *report, int usage, int enforce_min)
/* Find a field with a specific usage within a report  */
static struct hid_field* pidff_find_special_field(struct hid_report *report, int usage, int enforce_min)
{
	int i;
	for (i = 0; i < report->maxfield; i++) {
		if (report->field[i]->logical == (HID_UP_PID | usage) &&
		    report->field[i]->report_count > 0) {
			if (!enforce_min ||
			    report->field[i]->logical_minimum == 1)
				return report->field[i];
			else {
				printk(KERN_ERR "hid-pidff: logical_minimum "
					"is not 1 as it should be\n");
				return NULL;
			}
		}
	}
	return NULL;
}