summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/gspca.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-04-21 19:05:44 +0200
committerJean-Francois Moine <moinejf@free.fr>2009-04-21 19:05:44 +0200
commit27fcff0ad226c68320c8b72afff4a431d25d4462 (patch)
treeb55a1fa68c11ceaa83291aca5d8156fef69a1ac4 /linux/drivers/media/video/gspca/gspca.c
parentc1c75c6d10a30d067a92060e5061488642663341 (diff)
downloadmediapointer-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.c4
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);