All of lore.kernel.org
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: Antti Palosaari <crope@iki.fi>
Cc: linux-media <linux-media@vger.kernel.org>
Subject: [PATCH 2/2] dvb_usb_v2 Allow d->props.bInterfaceNumber to set the correct  interface.
Date: Wed, 13 Jun 2012 23:26:36 +0100	[thread overview]
Message-ID: <1339626396.2421.75.camel@Route3278> (raw)

Although the interface could be set in identify state, ideally it should be done in
the probe.

Allow d->props.bInterfaceNumber try to set the correct interface rather than return error.


Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/media/dvb/dvb-usb/dvb_usb_init.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_init.c b/drivers/media/dvb/dvb-usb/dvb_usb_init.c
index c16a28a..b2eb8ac 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb_init.c
+++ b/drivers/media/dvb/dvb-usb/dvb_usb_init.c
@@ -391,8 +391,15 @@ int dvb_usbv2_probe(struct usb_interface *intf,
 
 	if (d->intf->cur_altsetting->desc.bInterfaceNumber !=
 			d->props.bInterfaceNumber) {
-		ret = -ENODEV;
-		goto err_kfree;
+		usb_reset_configuration(d->udev);
+
+		ret = usb_set_interface(d->udev,
+			d->intf->cur_altsetting->desc.bInterfaceNumber,
+				d->props.bInterfaceNumber);
+		if (ret < 0) {
+			ret = -ENODEV;
+			goto err_kfree;
+		}
 	}
 
 	mutex_init(&d->usb_mutex);
-- 
1.7.10









             reply	other threads:[~2012-06-13 22:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 22:26 Malcolm Priestley [this message]
2012-06-13 22:55 ` [PATCH 2/2] dvb_usb_v2 Allow d->props.bInterfaceNumber to set the correct interface Antti Palosaari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339626396.2421.75.camel@Route3278 \
    --to=tvboxspy@gmail.com \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.