Commit 6121ca57 authored by Jean-François Moine's avatar Jean-François Moine Committed by Mauro Carvalho Chehab
Browse files

[media] gspca: Remove the useless variable 'nbalt'



As the alternate settings are now sorted in gspca main,
the variable 'nbalt' is no more useful.

Signed-off-by: default avatarJean-François Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a6764879
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -134,13 +134,17 @@ static int sd_start(struct gspca_dev *gspca_dev)

static void sd_stopN(struct gspca_dev *gspca_dev)
{
	struct usb_interface *intf;

	reg_w(gspca_dev, 0x003c, 0x0003);
	reg_w(gspca_dev, 0x003c, 0x0004);
	reg_w(gspca_dev, 0x003c, 0x0005);
	reg_w(gspca_dev, 0x003c, 0x0006);
	reg_w(gspca_dev, 0x003c, 0x0007);

	intf = usb_ifnum_to_if(gspca_dev->dev, gspca_dev->iface);
	usb_set_interface(gspca_dev->dev, gspca_dev->iface,
					gspca_dev->nbalt - 1);
					intf->num_altsetting - 1);
}

static void sd_pkt_scan(struct gspca_dev *gspca_dev,
+0 −1
Original line number Diff line number Diff line
@@ -337,7 +337,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
		return -1;

	cam = &gspca_dev->cam;
	gspca_dev->nbalt = 4;

	switch (sd->sensor) {
	case ID_MI1320:
+1 −2
Original line number Diff line number Diff line
@@ -880,7 +880,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
	for (;;) {
		if (alt != gspca_dev->alt) {
			alt = gspca_dev->alt;
			if (gspca_dev->nbalt > 1) {
			if (intf->num_altsetting > 1) {
				ret = usb_set_interface(gspca_dev->dev,
							gspca_dev->iface,
							alt);
@@ -2300,7 +2300,6 @@ int gspca_dev_probe2(struct usb_interface *intf,
	}
	gspca_dev->dev = dev;
	gspca_dev->iface = intf->cur_altsetting->desc.bInterfaceNumber;
	gspca_dev->nbalt = intf->num_altsetting;

	/* check if any audio device */
	if (dev->config->desc.bNumInterfaces != 1) {
+0 −1
Original line number Diff line number Diff line
@@ -207,7 +207,6 @@ struct gspca_dev {
	char memory;			/* memory type (V4L2_MEMORY_xxx) */
	__u8 iface;			/* USB interface number */
	__u8 alt;			/* USB alternate setting */
	__u8 nbalt;			/* number of USB alternate settings */
	u8 audio;			/* presence of audio device */
};

+0 −3
Original line number Diff line number Diff line
@@ -247,9 +247,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
	gspca_dev->cam.cam_mode = vga_mode;
	gspca_dev->cam.nmodes = ARRAY_SIZE(vga_mode);
	gspca_dev->cam.no_urb_create = 1;
	/* The highest alt setting has an isoc packetsize of 0, so we
	   don't want to use it */
	gspca_dev->nbalt--;

	sd->brightness  = BRIGHTNESS_DEFAULT;
	sd->contrast    = CONTRAST_DEFAULT;
Loading