usbdev_add(udev); 
int usb_new_device(struct usb_device *udev){	int err;	int c;	err = usb_get_configuration(udev);	if (err < 0) {		dev_err(&udev->dev, "can't read configurations, error %d\n",			err);		goto fail;	}	/* read the standard strings and cache them if present */	get_string(udev, &udev->product, udev->descriptor.iProduct);	get_string(udev, &udev->manufacturer, udev->descriptor.iManufacturer);	get_string(udev, &udev->serial, udev->descriptor.iSerialNumber);	/* Tell the world! */	dev_dbg(&udev->dev, "new device strings: Mfr=%d, Product=%d, "			"SerialNumber=%d\n",			udev->descriptor.iManufacturer,			udev->descriptor.iProduct,			udev->descriptor.iSerialNumber);	show_string(udev, "Product", udev->product);	show_string(udev, "Manufacturer", udev->manufacturer);	show_string(udev, "SerialNumber", udev->serial);#ifdef	CONFIG_USB_OTG	/*	 * OTG-aware devices on OTG-capable root hubs may be able to use SRP,	 * to wake us after we've powered off VBUS; and HNP, switching roles	 * "host" to "peripheral".  The OTG descriptor helps figure this out.	 */	if (!udev->bus->is_b_host			&& udev->config			&& udev->parent == udev->bus->root_hub) {		struct usb_otg_descriptor	*desc = 0;		struct usb_bus			*bus = udev->bus;		/* descriptor may appear anywhere in config */		if (__usb_get_extra_descriptor (udev->rawdescriptors[0],					le16_to_cpu(udev->config[0].desc.wTotalLength),					USB_DT_OTG, (void **) &desc) == 0) {			if (desc->bmAttributes & USB_OTG_HNP) {				unsigned		port1;				struct usb_device	*root = udev->parent;								for (port1 = 1; port1 <= root->maxchild;						port1++) {					if (root->children[port1-1] == udev)						break;				}				dev_info(&udev->dev,					"Dual-Role OTG device on %sHNP port\n",					(port1 == bus->otg_port)						? "" : "non-");				/* enable HNP before suspend, it's simpler */				if (port1 == bus->otg_port)					bus->b_hnp_enable = 1;				err = usb_control_msg(udev,					usb_sndctrlpipe(udev, 0),					USB_REQ_SET_FEATURE, 0,					bus->b_hnp_enable						? USB_DEVICE_B_HNP_ENABLE						: USB_DEVICE_A_ALT_HNP_SUPPORT,					0, NULL, 0, USB_CTRL_SET_TIMEOUT);				if (err < 0) {					/* OTG MESSAGE: report errors here,					 * customize to match your product.					 */					dev_info(&udev->dev,						"can't set HNP mode; %d\n",						err);					bus->b_hnp_enable = 0;				}			}		}	}	if (!is_targeted(udev)) {		/* Maybe it can talk to us, though we can't talk to it.		 * (Includes HNP test device.)		 */		if (udev->bus->b_hnp_enable || udev->bus->is_b_host) {			static int __usb_suspend_device (struct usb_device *,						int port1, pm_message_t state);			err = __usb_suspend_device(udev,					udev->bus->otg_port,					PMSG_SUSPEND);			if (err < 0)				dev_dbg(&udev->dev, "HNP fail, %d\n", err);		}		err = -ENODEV;		goto fail;	}#endif	/* put device-specific files into sysfs */	err = device_add (&udev->dev);	if (err) {		dev_err(&udev->dev, "can't device_add, error %d\n", err);		goto fail;	}	usb_create_sysfs_dev_files (udev);	/* choose and set the configuration. that registers the interfaces	 * with the driver core, and lets usb device drivers bind to them.	 */	c = choose_configuration(udev);	if (c < 0)		dev_warn(&udev->dev,				"can't choose an initial configuration\n");	else {		err = usb_set_configuration(udev, c);		if (err) {			dev_err(&udev->dev, "can't set config #%d, error %d\n",					c, err);			usb_remove_sysfs_dev_files(udev);			device_del(&udev->dev);			goto fail;		}	}	/* USB device state == configured ... usable */	/* add a /proc/bus/usb entry */	usbfs_add_device(udev);	return 0;fail:	usb_set_device_state(udev, USB_STATE_NOTATTACHED);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/fbf82fd2e1f4e679c60516d772d1862c941ca845/hub.c/clean/drivers/usb/core/hub.c