diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-12-30 05:58:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-06 06:00:46 -0500 |
commit | 66957b864646e2ea0aebc66d1173f39a63509a19 (patch) | |
tree | 9caca677f4590e18bf5995cd4eb27c6dd3248b33 /drivers/media/video | |
parent | 18bef42c2d9a63e028261b88e9202b6d0d34292b (diff) |
[media] gspca - main: rename build_ep_tb to build_isoc_ep_tb
After the "gspca: Fix bulk mode cameras no longer working (regression fix)"
patch build_ep_tb is no longer being called for bulk endpoints.
This patch renames build_ep_tb to build_isoc_ep_tb to make clear it should
only be called for isoc mode cameras.
This patch also:
- drops the no longer needed xfer parameter
- removes a check for bulk mode from the build_isoc_ep_tb code
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index cdd43ff4aa02..5b8f4fc5d1c6 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -675,9 +675,8 @@ struct ep_tb_s { | |||
675 | * build the table of the endpoints | 675 | * build the table of the endpoints |
676 | * and compute the minimum bandwidth for the image transfer | 676 | * and compute the minimum bandwidth for the image transfer |
677 | */ | 677 | */ |
678 | static int build_ep_tb(struct gspca_dev *gspca_dev, | 678 | static int build_isoc_ep_tb(struct gspca_dev *gspca_dev, |
679 | struct usb_interface *intf, | 679 | struct usb_interface *intf, |
680 | int xfer, | ||
681 | struct ep_tb_s *ep_tb) | 680 | struct ep_tb_s *ep_tb) |
682 | { | 681 | { |
683 | struct usb_host_endpoint *ep; | 682 | struct usb_host_endpoint *ep; |
@@ -695,13 +694,12 @@ static int build_ep_tb(struct gspca_dev *gspca_dev, | |||
695 | ep_tb->bandwidth = 2000 * 2000 * 120; | 694 | ep_tb->bandwidth = 2000 * 2000 * 120; |
696 | found = 0; | 695 | found = 0; |
697 | for (j = 0; j < nbalt; j++) { | 696 | for (j = 0; j < nbalt; j++) { |
698 | ep = alt_xfer(&intf->altsetting[j], xfer); | 697 | ep = alt_xfer(&intf->altsetting[j], |
698 | USB_ENDPOINT_XFER_ISOC); | ||
699 | if (ep == NULL) | 699 | if (ep == NULL) |
700 | continue; | 700 | continue; |
701 | psize = le16_to_cpu(ep->desc.wMaxPacketSize); | 701 | psize = le16_to_cpu(ep->desc.wMaxPacketSize); |
702 | if (!gspca_dev->cam.bulk) /* isoc */ | 702 | psize = (psize & 0x07ff) * (1 + ((psize >> 11) & 3)); |
703 | psize = (psize & 0x07ff) * | ||
704 | (1 + ((psize >> 11) & 3)); | ||
705 | bandwidth = psize * ep->desc.bInterval * 1000; | 703 | bandwidth = psize * ep->desc.bInterval * 1000; |
706 | if (gspca_dev->dev->speed == USB_SPEED_HIGH | 704 | if (gspca_dev->dev->speed == USB_SPEED_HIGH |
707 | || gspca_dev->dev->speed == USB_SPEED_SUPER) | 705 | || gspca_dev->dev->speed == USB_SPEED_SUPER) |
@@ -856,7 +854,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev) | |||
856 | xfer = gspca_dev->cam.bulk ? USB_ENDPOINT_XFER_BULK | 854 | xfer = gspca_dev->cam.bulk ? USB_ENDPOINT_XFER_BULK |
857 | : USB_ENDPOINT_XFER_ISOC; | 855 | : USB_ENDPOINT_XFER_ISOC; |
858 | 856 | ||
859 | /* if the subdriver forced an altsetting, get the endpoint */ | 857 | /* if bulk or the subdriver forced an altsetting, get the endpoint */ |
860 | if (gspca_dev->alt != 0) { | 858 | if (gspca_dev->alt != 0) { |
861 | gspca_dev->alt--; /* (previous version compatibility) */ | 859 | gspca_dev->alt--; /* (previous version compatibility) */ |
862 | ep = alt_xfer(&intf->altsetting[gspca_dev->alt], xfer); | 860 | ep = alt_xfer(&intf->altsetting[gspca_dev->alt], xfer); |
@@ -871,7 +869,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev) | |||
871 | 869 | ||
872 | /* else, compute the minimum bandwidth | 870 | /* else, compute the minimum bandwidth |
873 | * and build the endpoint table */ | 871 | * and build the endpoint table */ |
874 | alt_idx = build_ep_tb(gspca_dev, intf, xfer, ep_tb); | 872 | alt_idx = build_isoc_ep_tb(gspca_dev, intf, ep_tb); |
875 | if (alt_idx <= 0) { | 873 | if (alt_idx <= 0) { |
876 | pr_err("no transfer endpoint found\n"); | 874 | pr_err("no transfer endpoint found\n"); |
877 | ret = -EIO; | 875 | ret = -EIO; |