Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15512
b: refs/heads/master
c: f5691d7
h: refs/heads/master
v: v3
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed Jan 4, 2006
1 parent 4296121 commit 10b2fc8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9714c845c0681a203a9ae22aa5165ec72c51d33
refs/heads/master: f5691d70d4aeec0ac9cff11f0cabb7d5a1735705
23 changes: 13 additions & 10 deletions trunk/drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,23 @@ void usb_driver_release_interface(struct usb_driver *driver,
iface->condition = USB_INTERFACE_UNBOUND;
mark_quiesced(iface);
}
struct find_interface_arg {
int minor;
struct usb_interface *interface;
};

static int __find_interface(struct device * dev, void * data)
{
struct usb_interface ** ret = (struct usb_interface **)data;
struct usb_interface * intf = *ret;
int *minor = (int *)data;
struct find_interface_arg *arg = data;
struct usb_interface *intf;

/* can't look at usb devices, only interfaces */
if (dev->driver == &usb_generic_driver)
return 0;

intf = to_usb_interface(dev);
if (intf->minor != -1 && intf->minor == *minor) {
*ret = intf;
if (intf->minor != -1 && intf->minor == arg->minor) {
arg->interface = intf;
return 1;
}
return 0;
Expand All @@ -222,12 +225,12 @@ static int __find_interface(struct device * dev, void * data)
*/
struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor)
{
struct usb_interface *intf = (struct usb_interface *)(long)minor;
int ret;

ret = driver_for_each_device(&drv->driver, NULL, &intf, __find_interface);
struct find_interface_arg argb;

return ret ? intf : NULL;
argb.minor = minor;
argb.interface = NULL;
driver_for_each_device(&drv->driver, NULL, &argb, __find_interface);
return argb.interface;
}

#ifdef CONFIG_HOTPLUG
Expand Down

0 comments on commit 10b2fc8

Please sign in to comment.