Skip to content

Commit

Permalink
[media] gspca - main: Handle the xHCI error on usb_set_interface()
Browse files Browse the repository at this point in the history
This patch is adapted from a patch from Sarah Sharp (2010/05/03).
The xHCD handler checks the USB bandwidth on usb_set_interface()
instead of on usb_submit_urb().
Now, the same treatment is applied in case of error of both functions.

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jean-François Moine authored and Mauro Carvalho Chehab committed Sep 24, 2011
1 parent 27b1202 commit 4274d84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,8 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
gspca_dev->iface,
alt);
if (ret < 0) {
if (ret == -ENOSPC)
goto retry; /*fixme: ugly*/
pr_err("set alt %d err %d\n", alt, ret);
goto out;
}
Expand Down Expand Up @@ -942,6 +944,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)

/* the bandwidth is not wide enough
* negotiate or try a lower alternate setting */
retry:
PDEBUG(D_ERR|D_STREAM,
"alt %d - bandwidth not wide enough - trying again",
alt);
Expand Down

0 comments on commit 4274d84

Please sign in to comment.