diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-04-21 19:05:44 +0200 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2009-04-21 19:05:44 +0200 |
commit | 27fcff0ad226c68320c8b72afff4a431d25d4462 (patch) | |
tree | b55a1fa68c11ceaa83291aca5d8156fef69a1ac4 /linux/drivers/media/video/gspca/gspca.c | |
parent | c1c75c6d10a30d067a92060e5061488642663341 (diff) | |
download | mediapointer-dvb-s2-27fcff0ad226c68320c8b72afff4a431d25d4462.tar.gz mediapointer-dvb-s2-27fcff0ad226c68320c8b72afff4a431d25d4462.tar.bz2 |
gspca - main: Set the current alternate setting only when needed.
From: Jean-Francois Moine <moinejf@free.fr>
Priority: normal
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca/gspca.c')
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c index cbdfd7552..e7f9e37d4 100644 --- a/linux/drivers/media/video/gspca/gspca.c +++ b/linux/drivers/media/video/gspca/gspca.c @@ -498,7 +498,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) } PDEBUG(D_STREAM, "use alt %d ep 0x%02x", i, ep->desc.bEndpointAddress); - if (i > 0) { + if (gspca_dev->nbalt > 1) { ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i); if (ret < 0) { err("set alt %d err %d", i, ret); @@ -665,6 +665,8 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev) { int ret; + if (gspca_dev->alt == 0) + return 0; ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0); if (ret < 0) PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret); |