/* Returns the interface ID which was allocated; or -ENODEV if no more interface IDs can be allocated.  */
int usb_interface_id(struct usb_configuration *config, struct usb_function *function)
/* Returns the interface ID which was allocated; or -ENODEV if no more interface IDs can be allocated.  */
int usb_interface_id(struct usb_configuration *config, struct usb_function *function)
{
	unsigned char id = config->next_interface_id;
	if (id < MAX_CONFIG_INTERFACES) {
		config->interface[id] = function;
		config->next_interface_id = id + 1;
		return id;
	}
	return -ENODEV;
}