Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280870
b: refs/heads/master
c: ab14230
h: refs/heads/master
v: v3
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Dec 12, 2011
1 parent c44c764 commit 1c98c55
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 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: c5b963f809f378d4fedd6f2f09b36f50c5a37bd5
refs/heads/master: ab14230854aba9d0c99b3cd0e4bb1ef430973d84
36 changes: 22 additions & 14 deletions trunk/drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ static const char usbhsh_hcd_name[] = "renesas_usbhs host";
#define usbhsh_usbv_to_udev(d) dev_get_drvdata(&(d)->dev)

#define usbhsh_udev_to_usbv(h) ((h)->usbv)
#define usbhsh_udev_is_used(h) usbhsh_udev_to_usbv(h)

#define usbhsh_pipe_info(p) ((p)->mod_private)

Expand Down Expand Up @@ -231,27 +232,34 @@ static struct usbhsh_device *usbhsh_device_alloc(struct usbhsh_hpriv *hpriv,
int i;

/*
* device 0
* find device
*/
if (0 == usb_pipedevice(urb->pipe)) {
/*
* device0 is special case
*/
udev = usbhsh_device0(hpriv);
goto usbhsh_device_find;
}
if (usbhsh_udev_is_used(udev))
udev = NULL;
} else {
struct usbhsh_device *pos;

/*
* find unused device
*/
usbhsh_for_each_udev(udev, hpriv, i) {
if (usbhsh_udev_to_usbv(udev))
continue;
goto usbhsh_device_find;
/*
* find unused device
*/
usbhsh_for_each_udev(pos, hpriv, i) {
if (usbhsh_udev_is_used(pos))
continue;
udev = pos;
break;
}
}

dev_err(dev, "no free usbhsh_device\n");

return NULL;
if (!udev) {
dev_err(dev, "no free usbhsh_device\n");
return NULL;
}

usbhsh_device_find:
if (usbhsh_device_has_endpoint(udev))
dev_warn(dev, "udev have old endpoint\n");

Expand Down

0 comments on commit 1c98c55

Please sign in to comment.