提交 8dd07ef1 编写于 作者: J Jean-Francois Moine 提交者: Mauro Carvalho Chehab

V4L/DVB (11712): gspca - main: Set the current alternate setting only when needed

Signed-off-by: NJean-Francois Moine <moinejf@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 30d35e49
...@@ -486,7 +486,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) ...@@ -486,7 +486,7 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
} }
PDEBUG(D_STREAM, "use alt %d ep 0x%02x", PDEBUG(D_STREAM, "use alt %d ep 0x%02x",
i, ep->desc.bEndpointAddress); i, ep->desc.bEndpointAddress);
if (i > 0) { if (gspca_dev->nbalt > 1) {
ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i); ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, i);
if (ret < 0) { if (ret < 0) {
err("set alt %d err %d", i, ret); err("set alt %d err %d", i, ret);
...@@ -653,6 +653,8 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev) ...@@ -653,6 +653,8 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
{ {
int ret; int ret;
if (gspca_dev->alt == 0)
return 0;
ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0); ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0);
if (ret < 0) if (ret < 0)
PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret); PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册