diff options
author | Aapo Tahkola <aet@rasterburn.org> | 2007-05-08 11:56:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-07-18 13:23:39 -0400 |
commit | 55bbe5ea203373c07c10a9d1d5088dd013345027 (patch) | |
tree | 92207888036b4975abbd619ded3f83f7cdd41524 | |
parent | 47f8df0fc0a5bd2e7e46ca438715ffa290051f72 (diff) |
V4L/DVB (5693): M920x: second endpoint also needs to be changed to alt setting
Spotted by Jeremy Nysen.
Signed-off-by: Aapo Tahkola <aet@rasterburn.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/dvb-usb/m920x.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index 37e7f5881a82..350cdc90b9c8 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c | |||
@@ -104,6 +104,20 @@ static int m920x_init(struct dvb_usb_device *d, struct m920x_inits *rc_seq) | |||
104 | return ret; | 104 | return ret; |
105 | } | 105 | } |
106 | 106 | ||
107 | static int m920x_init_ep(struct usb_interface *intf) | ||
108 | { | ||
109 | struct usb_device *udev = interface_to_usbdev(intf); | ||
110 | struct usb_host_interface *alt; | ||
111 | |||
112 | if ((alt = usb_altnum_to_altsetting(intf, 1)) == NULL) { | ||
113 | deb("No alt found!\n"); | ||
114 | return -ENODEV; | ||
115 | } | ||
116 | |||
117 | return usb_set_interface(udev, alt->desc.bInterfaceNumber, | ||
118 | alt->desc.bAlternateSetting); | ||
119 | } | ||
120 | |||
107 | static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 121 | static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
108 | { | 122 | { |
109 | struct m920x_state *m = d->priv; | 123 | struct m920x_state *m = d->priv; |
@@ -577,8 +591,7 @@ static struct dvb_usb_device_properties dposh_properties; | |||
577 | static int m920x_probe(struct usb_interface *intf, | 591 | static int m920x_probe(struct usb_interface *intf, |
578 | const struct usb_device_id *id) | 592 | const struct usb_device_id *id) |
579 | { | 593 | { |
580 | struct dvb_usb_device *d; | 594 | struct dvb_usb_device *d = NULL; |
581 | struct usb_host_interface *alt; | ||
582 | int ret; | 595 | int ret; |
583 | struct m920x_inits *rc_init_seq = NULL; | 596 | struct m920x_inits *rc_init_seq = NULL; |
584 | int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber; | 597 | int bInterfaceNumber = intf->cur_altsetting->desc.bInterfaceNumber; |
@@ -623,23 +636,13 @@ static int m920x_probe(struct usb_interface *intf, | |||
623 | * tvwalkertwin_properties already configured both | 636 | * tvwalkertwin_properties already configured both |
624 | * tuners, so there is nothing for us to do here | 637 | * tuners, so there is nothing for us to do here |
625 | */ | 638 | */ |
626 | |||
627 | return -ENODEV; | ||
628 | } | 639 | } |
629 | 640 | ||
630 | found: | 641 | found: |
631 | alt = usb_altnum_to_altsetting(intf, 1); | 642 | if ((ret = m920x_init_ep(intf)) < 0) |
632 | if (alt == NULL) { | ||
633 | deb("No alt found!\n"); | ||
634 | return -ENODEV; | ||
635 | } | ||
636 | |||
637 | ret = usb_set_interface(d->udev, alt->desc.bInterfaceNumber, | ||
638 | alt->desc.bAlternateSetting); | ||
639 | if (ret < 0) | ||
640 | return ret; | 643 | return ret; |
641 | 644 | ||
642 | if ((ret = m920x_init(d, rc_init_seq)) != 0) | 645 | if (d && (ret = m920x_init(d, rc_init_seq)) != 0) |
643 | return ret; | 646 | return ret; |
644 | 647 | ||
645 | return ret; | 648 | return ret; |