Commit 11ff12fe authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

staging/easycap: easycap_probe : rename usb variables to common names

1. rename usb variables to more common names

struct usb_device *pusb_device -> usbdev
struct usb_host_interface *pusb_host_interface -> alt
struct usb_endpoint_descriptor *pepd ->
struct usb_interface_descriptor *pusb_interface_descriptor -> interface;

2. use usb_altnum_to_altsetting to access alternative settings

Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 24742ac6
...@@ -2975,13 +2975,13 @@ static const struct v4l2_file_operations v4l2_fops = { ...@@ -2975,13 +2975,13 @@ static const struct v4l2_file_operations v4l2_fops = {
* TIMES, ONCE FOR EACH OF THE THREE INTERFACES. BEWARE. * TIMES, ONCE FOR EACH OF THE THREE INTERFACES. BEWARE.
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static int easycap_usb_probe(struct usb_interface *pusb_interface, static int easycap_usb_probe(struct usb_interface *intf,
const struct usb_device_id *pusb_device_id) const struct usb_device_id *id)
{ {
struct usb_device *pusb_device; struct usb_device *usbdev;
struct usb_host_interface *pusb_host_interface; struct usb_host_interface *alt;
struct usb_endpoint_descriptor *pepd; struct usb_endpoint_descriptor *ep;
struct usb_interface_descriptor *pusb_interface_descriptor; struct usb_interface_descriptor *interface;
struct urb *purb; struct urb *purb;
struct easycap *peasycap; struct easycap *peasycap;
int ndong; int ndong;
...@@ -3010,23 +3010,17 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3010,23 +3010,17 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
struct inputset *inputset; struct inputset *inputset;
struct v4l2_device *pv4l2_device; struct v4l2_device *pv4l2_device;
/*---------------------------------------------------------------------------*/ usbdev = interface_to_usbdev(intf);
/*
* GET POINTER TO STRUCTURE usb_device
*/
/*---------------------------------------------------------------------------*/
pusb_device = interface_to_usbdev(pusb_interface);
JOT(4, "bNumConfigurations=%i\n", pusb_device->descriptor.bNumConfigurations);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
pusb_host_interface = pusb_interface->cur_altsetting; alt = usb_altnum_to_altsetting(intf, 0);
if (!pusb_host_interface) { if (!alt) {
SAY("ERROR: pusb_host_interface is NULL\n"); SAY("ERROR: usb_host_interface not found\n");
return -EFAULT; return -EFAULT;
} }
pusb_interface_descriptor = &(pusb_host_interface->desc); interface = &alt->desc;
if (!pusb_interface_descriptor) { if (!interface) {
SAY("ERROR: pusb_interface_descriptor is NULL\n"); SAY("ERROR: intf_descriptor is NULL\n");
return -EFAULT; return -EFAULT;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -3034,16 +3028,15 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3034,16 +3028,15 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
* GET PROPERTIES OF PROBED INTERFACE * GET PROPERTIES OF PROBED INTERFACE
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
bInterfaceNumber = pusb_interface_descriptor->bInterfaceNumber; bInterfaceNumber = interface->bInterfaceNumber;
bInterfaceClass = pusb_interface_descriptor->bInterfaceClass; bInterfaceClass = interface->bInterfaceClass;
bInterfaceSubClass = pusb_interface_descriptor->bInterfaceSubClass; bInterfaceSubClass = interface->bInterfaceSubClass;
JOT(4, "intf[%i]: num_altsetting=%i\n", JOT(4, "intf[%i]: num_altsetting=%i\n",
bInterfaceNumber, pusb_interface->num_altsetting); bInterfaceNumber, intf->num_altsetting);
JOT(4, "intf[%i]: cur_altsetting - altsetting=%li\n", JOT(4, "intf[%i]: cur_altsetting - altsetting=%li\n",
bInterfaceNumber, bInterfaceNumber,
(long int)(pusb_interface->cur_altsetting - (long int)(intf->cur_altsetting - intf->altsetting));
pusb_interface->altsetting));
JOT(4, "intf[%i]: bInterfaceClass=0x%02X bInterfaceSubClass=0x%02X\n", JOT(4, "intf[%i]: bInterfaceClass=0x%02X bInterfaceSubClass=0x%02X\n",
bInterfaceNumber, bInterfaceClass, bInterfaceSubClass); bInterfaceNumber, bInterfaceClass, bInterfaceSubClass);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -3129,8 +3122,8 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3129,8 +3122,8 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
* ... AND FURTHER INITIALIZE THE STRUCTURE * ... AND FURTHER INITIALIZE THE STRUCTURE
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
peasycap->pusb_device = pusb_device; peasycap->pusb_device = usbdev;
peasycap->pusb_interface = pusb_interface; peasycap->pusb_interface = intf;
peasycap->ilk = 0; peasycap->ilk = 0;
peasycap->microphone = false; peasycap->microphone = false;
...@@ -3264,7 +3257,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3264,7 +3257,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
for (ndong = 0; ndong < DONGLE_MANY; ndong++) { for (ndong = 0; ndong < DONGLE_MANY; ndong++) {
if (pusb_device == easycapdc60_dongle[ndong].peasycap-> if (usbdev == easycapdc60_dongle[ndong].peasycap->
pusb_device) { pusb_device) {
peasycap = easycapdc60_dongle[ndong].peasycap; peasycap = easycapdc60_dongle[ndong].peasycap;
JOT(8, "intf[%i]: dongle[%i].peasycap\n", JOT(8, "intf[%i]: dongle[%i].peasycap\n",
...@@ -3291,7 +3284,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3291,7 +3284,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
pv4l2_device = usb_get_intfdata(pusb_interface); pv4l2_device = usb_get_intfdata(intf);
if (!pv4l2_device) { if (!pv4l2_device) {
SAY("ERROR: pv4l2_device is NULL\n"); SAY("ERROR: pv4l2_device is NULL\n");
return -ENODEV; return -ENODEV;
...@@ -3340,34 +3333,34 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3340,34 +3333,34 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
isokalt = 0; isokalt = 0;
for (i = 0; i < pusb_interface->num_altsetting; i++) { for (i = 0; i < intf->num_altsetting; i++) {
pusb_host_interface = &(pusb_interface->altsetting[i]); alt = usb_altnum_to_altsetting(intf, i);
if (!pusb_host_interface) { if (!alt) {
SAM("ERROR: pusb_host_interface is NULL\n"); SAM("ERROR: alt is NULL\n");
return -EFAULT; return -EFAULT;
} }
pusb_interface_descriptor = &(pusb_host_interface->desc); interface = &alt->desc;
if (!pusb_interface_descriptor) { if (!interface) {
SAM("ERROR: pusb_interface_descriptor is NULL\n"); SAM("ERROR: intf_descriptor is NULL\n");
return -EFAULT; return -EFAULT;
} }
JOM(4, "intf[%i]alt[%i]: desc.bDescriptorType=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.bDescriptorType=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bDescriptorType); bInterfaceNumber, i, interface->bDescriptorType);
JOM(4, "intf[%i]alt[%i]: desc.bInterfaceNumber=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.bInterfaceNumber=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceNumber); bInterfaceNumber, i, interface->bInterfaceNumber);
JOM(4, "intf[%i]alt[%i]: desc.bAlternateSetting=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.bAlternateSetting=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bAlternateSetting); bInterfaceNumber, i, interface->bAlternateSetting);
JOM(4, "intf[%i]alt[%i]: desc.bNumEndpoints=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.bNumEndpoints=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bNumEndpoints); bInterfaceNumber, i, interface->bNumEndpoints);
JOM(4, "intf[%i]alt[%i]: desc.bInterfaceClass=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.bInterfaceClass=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceClass); bInterfaceNumber, i, interface->bInterfaceClass);
JOM(4, "intf[%i]alt[%i]: desc.bInterfaceSubClass=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.bInterfaceSubClass=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceSubClass); bInterfaceNumber, i, interface->bInterfaceSubClass);
JOM(4, "intf[%i]alt[%i]: desc.bInterfaceProtocol=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.bInterfaceProtocol=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->bInterfaceProtocol); bInterfaceNumber, i, interface->bInterfaceProtocol);
JOM(4, "intf[%i]alt[%i]: desc.iInterface=0x%02X\n", JOM(4, "intf[%i]alt[%i]: desc.iInterface=0x%02X\n",
bInterfaceNumber, i, pusb_interface_descriptor->iInterface); bInterfaceNumber, i, interface->iInterface);
ISOCwMaxPacketSize = -1; ISOCwMaxPacketSize = -1;
BULKwMaxPacketSize = -1; BULKwMaxPacketSize = -1;
...@@ -3376,34 +3369,34 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3376,34 +3369,34 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
ISOCbEndpointAddress = 0; ISOCbEndpointAddress = 0;
INTbEndpointAddress = 0; INTbEndpointAddress = 0;
if (0 == pusb_interface_descriptor->bNumEndpoints) if (0 == interface->bNumEndpoints)
JOM(4, "intf[%i]alt[%i] has no endpoints\n", JOM(4, "intf[%i]alt[%i] has no endpoints\n",
bInterfaceNumber, i); bInterfaceNumber, i);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
for (j = 0; j < pusb_interface_descriptor->bNumEndpoints; j++) { for (j = 0; j < interface->bNumEndpoints; j++) {
pepd = &(pusb_host_interface->endpoint[j].desc); ep = &alt->endpoint[j].desc;
if (!pepd) { if (!ep) {
SAM("ERROR: pepd is NULL.\n"); SAM("ERROR: ep is NULL.\n");
SAM("...... skipping\n"); SAM("...... skipping\n");
continue; continue;
} }
wMaxPacketSize = le16_to_cpu(pepd->wMaxPacketSize); wMaxPacketSize = le16_to_cpu(ep->wMaxPacketSize);
bEndpointAddress = pepd->bEndpointAddress; bEndpointAddress = ep->bEndpointAddress;
JOM(4, "intf[%i]alt[%i]end[%i]: bEndpointAddress=0x%X\n", JOM(4, "intf[%i]alt[%i]end[%i]: bEndpointAddress=0x%X\n",
bInterfaceNumber, i, j, bInterfaceNumber, i, j,
pepd->bEndpointAddress); ep->bEndpointAddress);
JOM(4, "intf[%i]alt[%i]end[%i]: bmAttributes=0x%X\n", JOM(4, "intf[%i]alt[%i]end[%i]: bmAttributes=0x%X\n",
bInterfaceNumber, i, j, bInterfaceNumber, i, j,
pepd->bmAttributes); ep->bmAttributes);
JOM(4, "intf[%i]alt[%i]end[%i]: wMaxPacketSize=%i\n", JOM(4, "intf[%i]alt[%i]end[%i]: wMaxPacketSize=%i\n",
bInterfaceNumber, i, j, bInterfaceNumber, i, j,
pepd->wMaxPacketSize); ep->wMaxPacketSize);
JOM(4, "intf[%i]alt[%i]end[%i]: bInterval=%i\n", JOM(4, "intf[%i]alt[%i]end[%i]: bInterval=%i\n",
bInterfaceNumber, i, j, bInterfaceNumber, i, j,
pepd->bInterval); ep->bInterval);
if (pepd->bEndpointAddress & USB_DIR_IN) { if (ep->bEndpointAddress & USB_DIR_IN) {
JOM(4, "intf[%i]alt[%i]end[%i] is an IN endpoint\n", JOM(4, "intf[%i]alt[%i]end[%i] is an IN endpoint\n",
bInterfaceNumber, i, j); bInterfaceNumber, i, j);
isin = 1; isin = 1;
...@@ -3414,7 +3407,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3414,7 +3407,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
SAM("...... continuing\n"); SAM("...... continuing\n");
isin = 0; isin = 0;
} }
if ((pepd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_ISOC) { USB_ENDPOINT_XFER_ISOC) {
JOM(4, "intf[%i]alt[%i]end[%i] is an ISOC endpoint\n", JOM(4, "intf[%i]alt[%i]end[%i] is an ISOC endpoint\n",
bInterfaceNumber, i, j); bInterfaceNumber, i, j);
...@@ -3427,7 +3420,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3427,7 +3420,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
"peasycap is NULL\n"); "peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (pepd->wMaxPacketSize) { if (ep->wMaxPacketSize) {
if (8 > isokalt) { if (8 > isokalt) {
okalt[isokalt] = i; okalt[isokalt] = i;
JOM(4, JOM(4,
...@@ -3435,7 +3428,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3435,7 +3428,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
okalt[isokalt], okalt[isokalt],
isokalt); isokalt);
okepn[isokalt] = okepn[isokalt] =
pepd-> ep->
bEndpointAddress & bEndpointAddress &
0x0F; 0x0F;
JOM(4, JOM(4,
...@@ -3443,7 +3436,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3443,7 +3436,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
okepn[isokalt], okepn[isokalt],
isokalt); isokalt);
okmps[isokalt] = okmps[isokalt] =
le16_to_cpu(pepd-> le16_to_cpu(ep->
wMaxPacketSize); wMaxPacketSize);
JOM(4, JOM(4,
"%i=okmps[%i]\n", "%i=okmps[%i]\n",
...@@ -3485,7 +3478,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3485,7 +3478,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
"peasycap is NULL\n"); "peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (pepd->wMaxPacketSize) { if (ep->wMaxPacketSize) {
if (8 > isokalt) { if (8 > isokalt) {
okalt[isokalt] = i ; okalt[isokalt] = i ;
JOM(4, JOM(4,
...@@ -3493,7 +3486,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3493,7 +3486,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
okalt[isokalt], okalt[isokalt],
isokalt); isokalt);
okepn[isokalt] = okepn[isokalt] =
pepd-> ep->
bEndpointAddress & bEndpointAddress &
0x0F; 0x0F;
JOM(4, JOM(4,
...@@ -3501,7 +3494,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3501,7 +3494,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
okepn[isokalt], okepn[isokalt],
isokalt); isokalt);
okmps[isokalt] = okmps[isokalt] =
le16_to_cpu(pepd-> le16_to_cpu(ep->
wMaxPacketSize); wMaxPacketSize);
JOM(4, JOM(4,
"%i=okmps[%i]\n", "%i=okmps[%i]\n",
...@@ -3539,12 +3532,12 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3539,12 +3532,12 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
break; break;
} }
} }
} else if ((pepd->bmAttributes & } else if ((ep->bmAttributes &
USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_BULK) { USB_ENDPOINT_XFER_BULK) {
JOM(4, "intf[%i]alt[%i]end[%i] is a BULK endpoint\n", JOM(4, "intf[%i]alt[%i]end[%i] is a BULK endpoint\n",
bInterfaceNumber, i, j); bInterfaceNumber, i, j);
} else if ((pepd->bmAttributes & } else if ((ep->bmAttributes &
USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_INT) { USB_ENDPOINT_XFER_INT) {
JOM(4, "intf[%i]alt[%i]end[%i] is an INT endpoint\n", JOM(4, "intf[%i]alt[%i]end[%i] is an INT endpoint\n",
...@@ -3553,7 +3546,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3553,7 +3546,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
JOM(4, "intf[%i]alt[%i]end[%i] is a CTRL endpoint\n", JOM(4, "intf[%i]alt[%i]end[%i] is a CTRL endpoint\n",
bInterfaceNumber, i, j); bInterfaceNumber, i, j);
} }
if (0 == pepd->wMaxPacketSize) { if (0 == ep->wMaxPacketSize) {
JOM(4, "intf[%i]alt[%i]end[%i] " JOM(4, "intf[%i]alt[%i]end[%i] "
"has zero packet size\n", "has zero packet size\n",
bInterfaceNumber, i, j); bInterfaceNumber, i, j);
...@@ -3566,7 +3559,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3566,7 +3559,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
JOM(4, "initialization begins for interface %i\n", JOM(4, "initialization begins for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber); interface->bInterfaceNumber);
switch (bInterfaceNumber) { switch (bInterfaceNumber) {
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
...@@ -3833,7 +3826,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3833,7 +3826,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
* SAVE POINTER peasycap IN THIS INTERFACE. * SAVE POINTER peasycap IN THIS INTERFACE.
*/ */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
usb_set_intfdata(pusb_interface, peasycap); usb_set_intfdata(intf, peasycap);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* IT IS ESSENTIAL TO INITIALIZE THE HARDWARE BEFORE, RATHER THAN AFTER, * IT IS ESSENTIAL TO INITIALIZE THE HARDWARE BEFORE, RATHER THAN AFTER,
...@@ -3855,7 +3848,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3855,7 +3848,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
* THE VIDEO DEVICE CAN BE REGISTERED NOW, AS IT IS READY. * THE VIDEO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
*/ */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
if (0 != (v4l2_device_register(&(pusb_interface->dev), if (0 != (v4l2_device_register(&(intf->dev),
&(peasycap->v4l2_device)))) { &(peasycap->v4l2_device)))) {
SAM("v4l2_device_register() failed\n"); SAM("v4l2_device_register() failed\n");
return -ENODEV; return -ENODEV;
...@@ -3913,9 +3906,9 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -3913,9 +3906,9 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
* SAVE POINTER peasycap IN INTERFACE 1 * SAVE POINTER peasycap IN INTERFACE 1
*/ */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
usb_set_intfdata(pusb_interface, peasycap); usb_set_intfdata(intf, peasycap);
JOM(4, "no initialization required for interface %i\n", JOM(4, "no initialization required for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber); interface->bInterfaceNumber);
break; break;
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
...@@ -4177,7 +4170,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -4177,7 +4170,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
* SAVE POINTER peasycap IN THIS INTERFACE. * SAVE POINTER peasycap IN THIS INTERFACE.
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
usb_set_intfdata(pusb_interface, peasycap); usb_set_intfdata(intf, peasycap);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* THE AUDIO DEVICE CAN BE REGISTERED NOW, AS IT IS READY. * THE AUDIO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
...@@ -4198,10 +4191,10 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -4198,10 +4191,10 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
} }
#else /* CONFIG_EASYCAP_OSS */ #else /* CONFIG_EASYCAP_OSS */
rc = usb_register_dev(pusb_interface, &easyoss_class); rc = usb_register_dev(intf, &easyoss_class);
if (rc) { if (rc) {
SAY("ERROR: usb_register_dev() failed\n"); SAY("ERROR: usb_register_dev() failed\n");
usb_set_intfdata(pusb_interface, NULL); usb_set_intfdata(intf, NULL);
return -ENODEV; return -ENODEV;
} else { } else {
JOM(8, "kref_get() with %i=kref.refcount.counter\n", JOM(8, "kref_get() with %i=kref.refcount.counter\n",
...@@ -4209,7 +4202,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface, ...@@ -4209,7 +4202,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
kref_get(&peasycap->kref); kref_get(&peasycap->kref);
peasycap->registered_audio++; peasycap->registered_audio++;
} }
SAM("easyoss attached to minor #%d\n", pusb_interface->minor); SAM("easyoss attached to minor #%d\n", intf->minor);
#endif /* CONFIG_EASYCAP_OSS */ #endif /* CONFIG_EASYCAP_OSS */
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment