/* This function returns the value of the function's bind(), which is zero for success else a negative errno value.  */
int __init usb_add_function(struct usb_configuration *config, struct usb_function *function)
/* This function returns the value of the function's bind(), which is zero for success else a negative errno value.  */
int __init usb_add_function(struct usb_configuration *config, struct usb_function *function)
{
	int	value = -EINVAL;
	DBG(config->cdev, "adding '%s'/%p to config '%s'/%p\n",
			function->name, function,
			config->label, config);
	if (!function->set_alt || !function->disable)
		goto done;
	function->config = config;
	list_add_tail(&function->list, &config->functions);
	if (function->bind) {
		value = function->bind(config, function);
		if (value < 0) {
			list_del(&function->list);
			function->config = NULL;
		}
	} else
		value = 0;
	if (!config->fullspeed && function->descriptors)
		config->fullspeed = true;
	if (!config->highspeed && function->hs_descriptors)
		config->highspeed = true;
done:
	if (value)
		DBG(config->cdev, "adding '%s'/%p --> %d\n",
				function->name, function, value);
	return value;
}