Commit 7dcef374 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

staging/easycap: add level 1 tabs in usb_probe/disconnect function

Add first level indentation before revamping the functions
This of course breaks 80 characters limit but it will be
fixed through the revamp
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 30a2cb35
...@@ -3145,139 +3145,139 @@ static const struct v4l2_file_operations v4l2_fops = { ...@@ -3145,139 +3145,139 @@ static const struct v4l2_file_operations v4l2_fops = {
static int easycap_usb_probe(struct usb_interface *pusb_interface, static int easycap_usb_probe(struct usb_interface *pusb_interface,
const struct usb_device_id *pusb_device_id) const struct usb_device_id *pusb_device_id)
{ {
struct usb_device *pusb_device, *pusb_device1; struct usb_device *pusb_device, *pusb_device1;
struct usb_host_interface *pusb_host_interface; struct usb_host_interface *pusb_host_interface;
struct usb_endpoint_descriptor *pepd; struct usb_endpoint_descriptor *pepd;
struct usb_interface_descriptor *pusb_interface_descriptor; struct usb_interface_descriptor *pusb_interface_descriptor;
struct usb_interface_assoc_descriptor *pusb_interface_assoc_descriptor; struct usb_interface_assoc_descriptor *pusb_interface_assoc_descriptor;
struct urb *purb; struct urb *purb;
struct easycap *peasycap; struct easycap *peasycap;
int ndong; int ndong;
struct data_urb *pdata_urb; struct data_urb *pdata_urb;
size_t wMaxPacketSize; size_t wMaxPacketSize;
int ISOCwMaxPacketSize; int ISOCwMaxPacketSize;
int BULKwMaxPacketSize; int BULKwMaxPacketSize;
int INTwMaxPacketSize; int INTwMaxPacketSize;
int CTRLwMaxPacketSize; int CTRLwMaxPacketSize;
u8 bEndpointAddress; u8 bEndpointAddress;
u8 ISOCbEndpointAddress; u8 ISOCbEndpointAddress;
u8 INTbEndpointAddress; u8 INTbEndpointAddress;
int isin, i, j, k, m, rc; int isin, i, j, k, m, rc;
u8 bInterfaceNumber; u8 bInterfaceNumber;
u8 bInterfaceClass; u8 bInterfaceClass;
u8 bInterfaceSubClass; u8 bInterfaceSubClass;
void *pbuf; void *pbuf;
int okalt[8], isokalt; int okalt[8], isokalt;
int okepn[8]; int okepn[8];
int okmps[8]; int okmps[8];
int maxpacketsize; int maxpacketsize;
u16 mask; u16 mask;
s32 value; s32 value;
struct easycap_format *peasycap_format; struct easycap_format *peasycap_format;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H #ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device; struct v4l2_device *pv4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* setup modules params */ /* setup modules params */
if (NULL == pusb_interface) { if (NULL == pusb_interface) {
SAY("ERROR: pusb_interface is NULL\n"); SAY("ERROR: pusb_interface is NULL\n");
return -EFAULT; return -EFAULT;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* GET POINTER TO STRUCTURE usb_device * GET POINTER TO STRUCTURE usb_device
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
pusb_device1 = container_of(pusb_interface->dev.parent, pusb_device1 = container_of(pusb_interface->dev.parent,
struct usb_device, dev); struct usb_device, dev);
if (NULL == pusb_device1) { if (NULL == pusb_device1) {
SAY("ERROR: pusb_device1 is NULL\n"); SAY("ERROR: pusb_device1 is NULL\n");
return -EFAULT; return -EFAULT;
} }
pusb_device = usb_get_dev(pusb_device1); pusb_device = usb_get_dev(pusb_device1);
if (NULL == pusb_device) { if (NULL == pusb_device) {
SAY("ERROR: pusb_device is NULL\n"); SAY("ERROR: pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
if ((unsigned long int)pusb_device1 != (unsigned long int)pusb_device) { if ((unsigned long int)pusb_device1 != (unsigned long int)pusb_device) {
JOT(4, "ERROR: pusb_device1 != pusb_device\n"); JOT(4, "ERROR: pusb_device1 != pusb_device\n");
return -EFAULT; return -EFAULT;
} }
JOT(4, "bNumConfigurations=%i\n", pusb_device->descriptor.bNumConfigurations); JOT(4, "bNumConfigurations=%i\n", pusb_device->descriptor.bNumConfigurations);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
pusb_host_interface = pusb_interface->cur_altsetting; pusb_host_interface = pusb_interface->cur_altsetting;
if (NULL == pusb_host_interface) { if (NULL == pusb_host_interface) {
SAY("ERROR: pusb_host_interface is NULL\n"); SAY("ERROR: pusb_host_interface is NULL\n");
return -EFAULT; return -EFAULT;
} }
pusb_interface_descriptor = &(pusb_host_interface->desc); pusb_interface_descriptor = &(pusb_host_interface->desc);
if (NULL == pusb_interface_descriptor) { if (NULL == pusb_interface_descriptor) {
SAY("ERROR: pusb_interface_descriptor is NULL\n"); SAY("ERROR: pusb_interface_descriptor is NULL\n");
return -EFAULT; return -EFAULT;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* GET PROPERTIES OF PROBED INTERFACE * GET PROPERTIES OF PROBED INTERFACE
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
bInterfaceNumber = pusb_interface_descriptor->bInterfaceNumber; bInterfaceNumber = pusb_interface_descriptor->bInterfaceNumber;
bInterfaceClass = pusb_interface_descriptor->bInterfaceClass; bInterfaceClass = pusb_interface_descriptor->bInterfaceClass;
bInterfaceSubClass = pusb_interface_descriptor->bInterfaceSubClass; bInterfaceSubClass = pusb_interface_descriptor->bInterfaceSubClass;
JOT(4, "intf[%i]: pusb_interface->num_altsetting=%i\n", JOT(4, "intf[%i]: pusb_interface->num_altsetting=%i\n",
bInterfaceNumber, pusb_interface->num_altsetting); bInterfaceNumber, pusb_interface->num_altsetting);
JOT(4, "intf[%i]: pusb_interface->cur_altsetting - " JOT(4, "intf[%i]: pusb_interface->cur_altsetting - "
"pusb_interface->altsetting=%li\n", bInterfaceNumber, "pusb_interface->altsetting=%li\n", bInterfaceNumber,
(long int)(pusb_interface->cur_altsetting - (long int)(pusb_interface->cur_altsetting -
pusb_interface->altsetting)); pusb_interface->altsetting));
switch (bInterfaceClass) { switch (bInterfaceClass) {
case USB_CLASS_AUDIO: { case USB_CLASS_AUDIO: {
JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_AUDIO\n", JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_AUDIO\n",
bInterfaceNumber, bInterfaceClass); break; bInterfaceNumber, bInterfaceClass); break;
} }
case USB_CLASS_VIDEO: { case USB_CLASS_VIDEO: {
JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VIDEO\n", JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VIDEO\n",
bInterfaceNumber, bInterfaceClass); break; bInterfaceNumber, bInterfaceClass); break;
} }
case USB_CLASS_VENDOR_SPEC: { case USB_CLASS_VENDOR_SPEC: {
JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VENDOR_SPEC\n", JOT(4, "intf[%i]: bInterfaceClass=0x%02X=USB_CLASS_VENDOR_SPEC\n",
bInterfaceNumber, bInterfaceClass); break; bInterfaceNumber, bInterfaceClass); break;
} }
default: default:
break; break;
} }
switch (bInterfaceSubClass) { switch (bInterfaceSubClass) {
case 0x01: { case 0x01: {
JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOCONTROL\n", JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOCONTROL\n",
bInterfaceNumber, bInterfaceSubClass); break; bInterfaceNumber, bInterfaceSubClass); break;
} }
case 0x02: { case 0x02: {
JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOSTREAMING\n", JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=AUDIOSTREAMING\n",
bInterfaceNumber, bInterfaceSubClass); break; bInterfaceNumber, bInterfaceSubClass); break;
} }
case 0x03: { case 0x03: {
JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=MIDISTREAMING\n", JOT(4, "intf[%i]: bInterfaceSubClass=0x%02X=MIDISTREAMING\n",
bInterfaceNumber, bInterfaceSubClass); break; bInterfaceNumber, bInterfaceSubClass); break;
} }
default: default:
break; break;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
pusb_interface_assoc_descriptor = pusb_interface->intf_assoc; pusb_interface_assoc_descriptor = pusb_interface->intf_assoc;
if (NULL != pusb_interface_assoc_descriptor) { if (NULL != pusb_interface_assoc_descriptor) {
JOT(4, "intf[%i]: bFirstInterface=0x%02X bInterfaceCount=0x%02X\n", JOT(4, "intf[%i]: bFirstInterface=0x%02X bInterfaceCount=0x%02X\n",
bInterfaceNumber, bInterfaceNumber,
pusb_interface_assoc_descriptor->bFirstInterface, pusb_interface_assoc_descriptor->bFirstInterface,
pusb_interface_assoc_descriptor->bInterfaceCount); pusb_interface_assoc_descriptor->bInterfaceCount);
} else { } else {
JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n", JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n",
bInterfaceNumber); bInterfaceNumber);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* A NEW struct easycap IS ALWAYS ALLOCATED WHEN INTERFACE 0 IS PROBED. * A NEW struct easycap IS ALWAYS ALLOCATED WHEN INTERFACE 0 IS PROBED.
...@@ -3289,7 +3289,7 @@ JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n", ...@@ -3289,7 +3289,7 @@ JOT(4, "intf[%i]: pusb_interface_assoc_descriptor is NULL\n",
* INTERFACES 1 AND 2 ARE PROBED. * INTERFACES 1 AND 2 ARE PROBED.
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (0 == bInterfaceNumber) { if (0 == bInterfaceNumber) {
peasycap = kzalloc(sizeof(struct easycap), GFP_KERNEL); peasycap = kzalloc(sizeof(struct easycap), GFP_KERNEL);
if (NULL == peasycap) { if (NULL == peasycap) {
SAY("ERROR: Could not allocate peasycap\n"); SAY("ERROR: Could not allocate peasycap\n");
...@@ -3525,7 +3525,7 @@ if (0 == bInterfaceNumber) { ...@@ -3525,7 +3525,7 @@ if (0 == bInterfaceNumber) {
peasycap->inputset[k].input = k; peasycap->inputset[k].input = k;
JOM(4, "populated easycap.inputset[]\n"); JOM(4, "populated easycap.inputset[]\n");
JOM(4, "finished initialization\n"); JOM(4, "finished initialization\n");
} else { } else {
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* FIXME * FIXME
...@@ -3579,7 +3579,7 @@ if (0 == bInterfaceNumber) { ...@@ -3579,7 +3579,7 @@ if (0 == bInterfaceNumber) {
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if ((USB_CLASS_VIDEO == bInterfaceClass) || if ((USB_CLASS_VIDEO == bInterfaceClass) ||
(USB_CLASS_VENDOR_SPEC == bInterfaceClass)) { (USB_CLASS_VENDOR_SPEC == bInterfaceClass)) {
if (-1 == peasycap->video_interface) { if (-1 == peasycap->video_interface) {
peasycap->video_interface = bInterfaceNumber; peasycap->video_interface = bInterfaceNumber;
...@@ -3594,7 +3594,7 @@ if ((USB_CLASS_VIDEO == bInterfaceClass) || ...@@ -3594,7 +3594,7 @@ if ((USB_CLASS_VIDEO == bInterfaceClass) ||
peasycap->video_interface); peasycap->video_interface);
} }
} }
} else if ((USB_CLASS_AUDIO == bInterfaceClass) && } else if ((USB_CLASS_AUDIO == bInterfaceClass) &&
(0x02 == bInterfaceSubClass)) { (0x02 == bInterfaceSubClass)) {
if (-1 == peasycap->audio_interface) { if (-1 == peasycap->audio_interface) {
peasycap->audio_interface = bInterfaceNumber; peasycap->audio_interface = bInterfaceNumber;
...@@ -3609,16 +3609,16 @@ if ((USB_CLASS_VIDEO == bInterfaceClass) || ...@@ -3609,16 +3609,16 @@ if ((USB_CLASS_VIDEO == bInterfaceClass) ||
peasycap->audio_interface); peasycap->audio_interface);
} }
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* INVESTIGATE ALL ALTSETTINGS. * INVESTIGATE ALL ALTSETTINGS.
* DONE IN DETAIL BECAUSE USB DEVICE 05e1:0408 HAS DISPARATE INCARNATIONS. * DONE IN DETAIL BECAUSE USB DEVICE 05e1:0408 HAS DISPARATE INCARNATIONS.
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
isokalt = 0; isokalt = 0;
for (i = 0; i < pusb_interface->num_altsetting; i++) { for (i = 0; i < pusb_interface->num_altsetting; i++) {
pusb_host_interface = &(pusb_interface->altsetting[i]); pusb_host_interface = &(pusb_interface->altsetting[i]);
if (NULL == pusb_host_interface) { if (NULL == pusb_host_interface) {
SAM("ERROR: pusb_host_interface is NULL\n"); SAM("ERROR: pusb_host_interface is NULL\n");
...@@ -3837,21 +3837,21 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) { ...@@ -3837,21 +3837,21 @@ for (i = 0; i < pusb_interface->num_altsetting; i++) {
bInterfaceNumber, i, j); bInterfaceNumber, i, j);
} }
} }
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* PERFORM INITIALIZATION OF THE PROBED INTERFACE * PERFORM INITIALIZATION OF THE PROBED INTERFACE
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
JOM(4, "initialization begins for interface %i\n", JOM(4, "initialization begins for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber); pusb_interface_descriptor->bInterfaceNumber);
switch (bInterfaceNumber) { switch (bInterfaceNumber) {
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* INTERFACE 0 IS THE VIDEO INTERFACE * INTERFACE 0 IS THE VIDEO INTERFACE
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
case 0: { case 0: {
if (!peasycap) { if (!peasycap) {
SAM("MISTAKE: peasycap is NULL\n"); SAM("MISTAKE: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
...@@ -4206,7 +4206,7 @@ case 0: { ...@@ -4206,7 +4206,7 @@ case 0: {
* INTERFACE 2 IS THE AUDIO STREAMING INTERFACE * INTERFACE 2 IS THE AUDIO STREAMING INTERFACE
*/ */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
case 1: { case 1: {
#ifdef EASYCAP_SILENT #ifdef EASYCAP_SILENT
return -ENOENT; return -ENOENT;
#endif /*EASYCAP_SILENT*/ #endif /*EASYCAP_SILENT*/
...@@ -4223,9 +4223,9 @@ case 1: { ...@@ -4223,9 +4223,9 @@ case 1: {
JOM(4, "no initialization required for interface %i\n", JOM(4, "no initialization required for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber); pusb_interface_descriptor->bInterfaceNumber);
break; break;
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
case 2: { case 2: {
#ifdef EASYCAP_SILENT #ifdef EASYCAP_SILENT
return -ENOENT; return -ENOENT;
#endif /*EASYCAP_SILENT*/ #endif /*EASYCAP_SILENT*/
...@@ -4530,14 +4530,14 @@ case 2: { ...@@ -4530,14 +4530,14 @@ case 2: {
* INTERFACES OTHER THAN 0, 1 AND 2 ARE UNEXPECTED * INTERFACES OTHER THAN 0, 1 AND 2 ARE UNEXPECTED
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
default: { default: {
JOM(4, "ERROR: unexpected interface %i\n", bInterfaceNumber); JOM(4, "ERROR: unexpected interface %i\n", bInterfaceNumber);
return -EINVAL; return -EINVAL;
} }
} }
SAM("ends successfully for interface %i\n", SAM("ends successfully for interface %i\n",
pusb_interface_descriptor->bInterfaceNumber); pusb_interface_descriptor->bInterfaceNumber);
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
...@@ -4550,50 +4550,50 @@ return 0; ...@@ -4550,50 +4550,50 @@ return 0;
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void easycap_usb_disconnect(struct usb_interface *pusb_interface) static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
{ {
struct usb_host_interface *pusb_host_interface; struct usb_host_interface *pusb_host_interface;
struct usb_interface_descriptor *pusb_interface_descriptor; struct usb_interface_descriptor *pusb_interface_descriptor;
u8 bInterfaceNumber; u8 bInterfaceNumber;
struct easycap *peasycap; struct easycap *peasycap;
struct list_head *plist_head; struct list_head *plist_head;
struct data_urb *pdata_urb; struct data_urb *pdata_urb;
int minor, m, kd; int minor, m, kd;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/ /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H #ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device; struct v4l2_device *pv4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
JOT(4, "\n"); JOT(4, "\n");
if (NULL == pusb_interface) { if (NULL == pusb_interface) {
JOT(4, "ERROR: pusb_interface is NULL\n"); JOT(4, "ERROR: pusb_interface is NULL\n");
return; return;
} }
pusb_host_interface = pusb_interface->cur_altsetting; pusb_host_interface = pusb_interface->cur_altsetting;
if (NULL == pusb_host_interface) { if (NULL == pusb_host_interface) {
JOT(4, "ERROR: pusb_host_interface is NULL\n"); JOT(4, "ERROR: pusb_host_interface is NULL\n");
return; return;
} }
pusb_interface_descriptor = &(pusb_host_interface->desc); pusb_interface_descriptor = &(pusb_host_interface->desc);
if (NULL == pusb_interface_descriptor) { if (NULL == pusb_interface_descriptor) {
JOT(4, "ERROR: pusb_interface_descriptor is NULL\n"); JOT(4, "ERROR: pusb_interface_descriptor is NULL\n");
return; return;
} }
bInterfaceNumber = pusb_interface_descriptor->bInterfaceNumber; bInterfaceNumber = pusb_interface_descriptor->bInterfaceNumber;
minor = pusb_interface->minor; minor = pusb_interface->minor;
JOT(4, "intf[%i]: minor=%i\n", bInterfaceNumber, minor); JOT(4, "intf[%i]: minor=%i\n", bInterfaceNumber, minor);
if (1 == bInterfaceNumber) if (1 == bInterfaceNumber)
return; return;
peasycap = usb_get_intfdata(pusb_interface); peasycap = usb_get_intfdata(pusb_interface);
if (NULL == peasycap) { if (NULL == peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return; return;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#ifdef EASYCAP_IS_VIDEODEV_CLIENT #ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H #ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
...@@ -4605,7 +4605,7 @@ if (NULL == peasycap) { ...@@ -4605,7 +4605,7 @@ if (NULL == peasycap) {
* TO DETECT THIS, THE STRING IN THE easycap.telltale[] BUFFER IS CHECKED. * TO DETECT THIS, THE STRING IN THE easycap.telltale[] BUFFER IS CHECKED.
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
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(pusb_interface);
if (NULL == pv4l2_device) { if (NULL == pv4l2_device) {
SAY("ERROR: pv4l2_device is NULL\n"); SAY("ERROR: pv4l2_device is NULL\n");
...@@ -4613,28 +4613,28 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { ...@@ -4613,28 +4613,28 @@ if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
} }
peasycap = (struct easycap *) peasycap = (struct easycap *)
container_of(pv4l2_device, struct easycap, v4l2_device); container_of(pv4l2_device, struct easycap, v4l2_device);
} }
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/ #endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
# #
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/ #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
SAY("ERROR: bad peasycap: 0x%08lX\n", (unsigned long int) peasycap); SAY("ERROR: bad peasycap: 0x%08lX\n", (unsigned long int) peasycap);
return; return;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* /*
* IF THE WAIT QUEUES ARE NOT CLEARED A DEADLOCK IS POSSIBLE. BEWARE. * IF THE WAIT QUEUES ARE NOT CLEARED A DEADLOCK IS POSSIBLE. BEWARE.
*/ */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
peasycap->video_eof = 1; peasycap->video_eof = 1;
peasycap->audio_eof = 1; peasycap->audio_eof = 1;
wake_up_interruptible(&(peasycap->wq_video)); wake_up_interruptible(&(peasycap->wq_video));
wake_up_interruptible(&(peasycap->wq_audio)); wake_up_interruptible(&(peasycap->wq_audio));
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
switch (bInterfaceNumber) { switch (bInterfaceNumber) {
case 0: { case 0: {
if (NULL != peasycap->purb_video_head) { if (NULL != peasycap->purb_video_head) {
JOM(4, "killing video urbs\n"); JOM(4, "killing video urbs\n");
m = 0; m = 0;
...@@ -4652,9 +4652,9 @@ case 0: { ...@@ -4652,9 +4652,9 @@ case 0: {
JOM(4, "%i video urbs killed\n", m); JOM(4, "%i video urbs killed\n", m);
} }
break; break;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
case 2: { case 2: {
if (NULL != peasycap->purb_audio_head) { if (NULL != peasycap->purb_audio_head) {
JOM(4, "killing audio urbs\n"); JOM(4, "killing audio urbs\n");
m = 0; m = 0;
...@@ -4672,9 +4672,9 @@ case 2: { ...@@ -4672,9 +4672,9 @@ case 2: {
JOM(4, "%i audio urbs killed\n", m); JOM(4, "%i audio urbs killed\n", m);
} }
break; break;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
default: default:
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