[PATCH 17/39] staging: comedi: usbduxfast: remove 'ifnum' from private data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The interface number is only needed during the attach of the
device. Remove it from the private data.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/usbduxfast.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c
index 59bbd4d..b51bd97 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -152,7 +152,6 @@ struct usbduxfast_private {
 	struct urb *urbIn;	/* BULK-transfer handling: urb */
 	int8_t *transfer_buffer;
 	int16_t *insnBuffer;	/* input buffer for single insn */
-	int ifnum;		/* interface number */
 	struct usb_interface *intf;	/* interface structure */
 	/* comedi device for the interrupt context */
 	struct comedi_device *comedidev;
@@ -1285,7 +1284,6 @@ static int usbduxfast_auto_attach(struct comedi_device *dev,
 	devpriv->comedidev = dev;
 	devpriv->usb = usb;
 	devpriv->intf = intf;
-	devpriv->ifnum = intf->altsetting->desc.bInterfaceNumber;
 	usb_set_intfdata(intf, devpriv);
 
 	devpriv->dux_commands = kmalloc(SIZEOFDUXBUFFER, GFP_KERNEL);
@@ -1296,7 +1294,8 @@ static int usbduxfast_auto_attach(struct comedi_device *dev,
 	if (!devpriv->insnBuffer)
 		return -ENOMEM;
 
-	ret = usb_set_interface(devpriv->usb, devpriv->ifnum, 1);
+	ret = usb_set_interface(devpriv->usb,
+				intf->altsetting->desc.bInterfaceNumber, 1);
 	if (ret < 0) {
 		dev_err(&intf->dev,
 			"could not switch to alternate setting 1\n");
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux