aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2009-04-21 13:05:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:20:55 -0400
commit8dd07ef1236356222207058ee6a83c24cc896e8d (patch)
tree0d9ac9ec019bbf6cccbe1caf14821170abb254e4 /drivers/media
parent30d35e49509345a3bee778e0cee8545cd70853e2 (diff)
V4L/DVB (11712): gspca - main: Set the current alternate setting only when needed
Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/gspca.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index efa4dd349f60..ebeae6bdacc8 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -486,7 +486,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
486 } 486 }
487 PDEBUG(D_STREAM, "use alt %d ep 0x%02x", 487 PDEBUG(D_STREAM, "use alt %d ep 0x%02x",
488 i, ep->desc.bEndpointAddress); 488 i, ep->desc.bEndpointAddress);
489 if (i > 0) { 489 if (gspca_dev->nbalt > 1) {
490 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i); 490 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i);
491 if (ret < 0) { 491 if (ret < 0) {
492 err("set alt %d err %d", i, ret); 492 err("set alt %d err %d", i, ret);
@@ -653,6 +653,8 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
653{ 653{
654 int ret; 654 int ret;
655 655
656 if (gspca_dev->alt == 0)
657 return 0;
656 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0); 658 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0);
657 if (ret < 0) 659 if (ret < 0)
658 PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret); 660 PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret);