Exemplo n.º 1
0
static int __ref
webcam_bind(struct usb_composite_dev *cdev)
{
	int ret;

	/* Allocate string descriptor numbers ... note that string contents
	 * can be overridden by the composite_dev glue.
	 */
	if ((ret = usb_string_id(cdev)) < 0)
		goto error;
	webcam_strings[STRING_MANUFACTURER_IDX].id = ret;
	webcam_device_descriptor.iManufacturer = ret;

	if ((ret = usb_string_id(cdev)) < 0)
		goto error;
	webcam_strings[STRING_PRODUCT_IDX].id = ret;
	webcam_device_descriptor.iProduct = ret;

	if ((ret = usb_string_id(cdev)) < 0)
		goto error;
	webcam_strings[STRING_DESCRIPTION_IDX].id = ret;
	webcam_config_driver.iConfiguration = ret;

	/* Register our configuration. */
	if ((ret = usb_add_config(cdev, &webcam_config_driver)) < 0)
		goto error;

	INFO(cdev, "Webcam Video Gadget\n");
	return 0;

error:
	webcam_unbind(cdev);
	return ret;
}
Exemplo n.º 2
0
static int __init
webcam_bind(struct usb_composite_dev *cdev)
{
	int ret;

	/* Allocate string descriptor numbers ... note that string contents
	 * can be overridden by the composite_dev glue.
	 */
	ret = usb_string_ids_tab(cdev, webcam_strings);
	if (ret < 0)
		goto error;
	webcam_device_descriptor.iManufacturer =
		webcam_strings[USB_GADGET_MANUFACTURER_IDX].id;
	webcam_device_descriptor.iProduct =
		webcam_strings[USB_GADGET_PRODUCT_IDX].id;
	webcam_config_driver.iConfiguration =
		webcam_strings[STRING_DESCRIPTION_IDX].id;

	/* Register our configuration. */
	if ((ret = usb_add_config(cdev, &webcam_config_driver,
					webcam_config_bind)) < 0)
		goto error;

	usb_composite_overwrite_options(cdev, &coverwrite);
	INFO(cdev, "Webcam Video Gadget\n");
	return 0;

error:
	webcam_unbind(cdev);
	return ret;
}
Exemplo n.º 3
0
static int __init
webcam_bind(struct usb_composite_dev *cdev)
{
	int ret;

	/*                                                                 
                                                
  */
	if ((ret = usb_string_id(cdev)) < 0)
		goto error;
	webcam_strings[STRING_MANUFACTURER_IDX].id = ret;
	webcam_device_descriptor.iManufacturer = ret;

	if ((ret = usb_string_id(cdev)) < 0)
		goto error;
	webcam_strings[STRING_PRODUCT_IDX].id = ret;
	webcam_device_descriptor.iProduct = ret;

	if ((ret = usb_string_id(cdev)) < 0)
		goto error;
	webcam_strings[STRING_DESCRIPTION_IDX].id = ret;
	webcam_config_driver.iConfiguration = ret;

	/*                             */
	if ((ret = usb_add_config(cdev, &webcam_config_driver,
					webcam_config_bind)) < 0)
		goto error;

	INFO(cdev, "Webcam Video Gadget\n");
	return 0;

error:
	webcam_unbind(cdev);
	return ret;
}