Commit 50e06dee authored by Jean-Francois Moine's avatar Jean-Francois Moine Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (10333): gspca - main and many subdrivers: Remove the epaddr variable.



The transfer endpoint address is now automatically chosen.

Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent afd46291
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -815,7 +815,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
	struct cam *cam;

	cam = &gspca_dev->cam;
	cam->epaddr = 0x01;
	cam->cam_mode = vga_mode;
	cam->nmodes = sizeof vga_mode / sizeof vga_mode[0];

+0 −1
Original line number Diff line number Diff line
@@ -658,7 +658,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
	struct cam *cam;

	cam = &gspca_dev->cam;
	cam->epaddr = 1;
	sd->sensor = id->driver_info;
	if (sd->sensor == SENSOR_PAS106) {
		cam->cam_mode = sif_mode;
+2 −4
Original line number Diff line number Diff line
@@ -259,7 +259,6 @@ static int sd_config(struct gspca_dev *gspca_dev,

	cam->cam_mode = fpix_mode;
	cam->nmodes = 1;
	cam->epaddr = 0x01;	/* todo: correct for all cams? */
	cam->bulk_size = FPIX_MAX_TRANSFER;

/*	gspca_dev->nbalt = 1;	 * use bulk transfer */
@@ -335,8 +334,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
	/* Read the result of the command. Ignore the result, for it
	 * varies with the device. */
	ret = usb_bulk_msg(gspca_dev->dev,
			usb_rcvbulkpipe(gspca_dev->dev,
					gspca_dev->cam.epaddr),
			gspca_dev->urb[0]->pipe,
			gspca_dev->usb_buf, FPIX_MAX_TRANSFER, &size_ret,
			FPIX_TIMEOUT);
	if (ret != 0) {
@@ -363,7 +361,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
	}

	/* Again, reset bulk in endpoint */
	usb_clear_halt(gspca_dev->dev, gspca_dev->cam.epaddr);
	usb_clear_halt(gspca_dev->dev, gspca_dev->urb[0]->pipe);

	/* Allocate a control URB */
	dev->control_urb = usb_alloc_urb(0, GFP_KERNEL);
+4 −13
Original line number Diff line number Diff line
@@ -439,22 +439,16 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
 * look for an input transfer endpoint in an alternate setting
 */
static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt,
					  __u8 epaddr,
					  __u8 xfer)
{
	struct usb_host_endpoint *ep;
	int i, attr;

	epaddr |= USB_DIR_IN;
	for (i = 0; i < alt->desc.bNumEndpoints; i++) {
		ep = &alt->endpoint[i];
		if (ep->desc.bEndpointAddress == epaddr) {
			attr = ep->desc.bmAttributes
						& USB_ENDPOINT_XFERTYPE_MASK;
		attr = ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
		if (attr == xfer)
			return ep;
			break;
		}
	}
	return NULL;
}
@@ -480,7 +474,6 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
	/* try isoc */
	while (--i > 0) {			/* alt 0 is unusable */
		ep = alt_xfer(&intf->altsetting[i],
				gspca_dev->cam.epaddr,
				USB_ENDPOINT_XFER_ISOC);
		if (ep)
			break;
@@ -489,7 +482,6 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev)
	/* if no isoc, try bulk */
	if (ep == NULL) {
		ep = alt_xfer(&intf->altsetting[0],
				gspca_dev->cam.epaddr,
				USB_ENDPOINT_XFER_BULK);
		if (ep == NULL) {
			err("no transfer endpoint found");
@@ -618,8 +610,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
		/* clear the bulk endpoint */
		if (gspca_dev->alt == 0)	/* if bulk transfer */
			usb_clear_halt(gspca_dev->dev,
					usb_rcvintpipe(gspca_dev->dev,
						 gspca_dev->cam.epaddr));
					gspca_dev->urb[0]->pipe);

		/* start the cam */
		ret = gspca_dev->sd_desc->start(gspca_dev);
+0 −1
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ struct cam {
				 * - cannot be > MAX_NURBS
				 * - when 0 and bulk_size != 0 means
				 *   1 URB and submit done by subdriver */
	__u8 epaddr;
};

struct gspca_dev;
Loading