/* Callers must own the device lock, so driver probe() entries don't need extra locking, but other call contexts may need to explicitly claim that lock.  */
int usb_driver_claim_interface(struct usb_driver *driver, struct usb_interface *iface, void *priv)
/* Callers must own the device lock, so driver probe() entries don't need extra locking, but other call contexts may need to explicitly claim that lock.  */
int usb_driver_claim_interface(struct usb_driver *driver, struct usb_interface *iface, void *priv)
{
	struct device *dev = &iface->dev;
	struct usb_device *udev = interface_to_usbdev(iface);
	int retval = 0;
	if (dev->driver)
		return -EBUSY;
	dev->driver = &driver->drvwrap.driver;
	usb_set_intfdata(iface, priv);
	iface->needs_binding = 0;
	usb_pm_lock(udev);
	iface->condition = USB_INTERFACE_BOUND;
	mark_active(iface);
	atomic_set(&iface->pm_usage_cnt, !driver->supports_autosuspend);
	usb_pm_unlock(udev);
	if (device_is_registered(dev))
		retval = device_bind_driver(dev);
	return retval;
}