/* Helper function for getting pointer to feature unit descriptor. This is needed in order to address audio specific requests to proper controls struct.  */
static struct feature_unit_descriptor* get_feature_unit(struct usb_audio_dev_data *audio_dev_data, uint8_t *device, uint8_t fu_id)
/* Helper function for getting pointer to feature unit descriptor. This is needed in order to address audio specific requests to proper controls struct.  */
static struct feature_unit_descriptor* get_feature_unit(struct usb_audio_dev_data *audio_dev_data, uint8_t *device, uint8_t fu_id)
{
	struct feature_unit_descriptor *fu;
	fu = (struct feature_unit_descriptor *)
		((uint8_t *)audio_dev_data->desc_hdr +
		audio_dev_data->desc_hdr->bLength +
		INPUT_TERMINAL_DESC_SIZE);
	if (fu->bUnitID == fu_id) {
		*device = 0;
		return fu;
	}
	fu = (struct feature_unit_descriptor *)
			((uint8_t *)fu + fu->bLength +
			INPUT_TERMINAL_DESC_SIZE +
			OUTPUT_TERMINAL_DESC_SIZE);
	*device = 1;
	return fu;
}