JOM(4, "ending successfully\n");
return 0;
}
-/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
-/*****************************************************************************/
-/*--------------------------------------------------------------------------*/
+
/*
- * THIS FUNCTION IS CALLED FROM WITHIN easycap_usb_disconnect() AND IS
- * PROTECTED BY SEMAPHORES SET AND CLEARED BY easycap_usb_disconnect().
- *
- * BY THIS STAGE THE DEVICE HAS ALREADY BEEN PHYSICALLY UNPLUGGED, SO
- * peasycap->pusb_device IS NO LONGER VALID.
+ * This function is called from within easycap_usb_disconnect() and is
+ * protected by semaphores set and cleared by easycap_usb_disconnect().
+ * By this stage the device has already been physically unplugged,
+ * so peasycap->pusb_device is no longer valid.
*/
-/*---------------------------------------------------------------------------*/
static void easycap_delete(struct kref *pkref)
{
struct easycap *peasycap;
return;
}
kd = easycap_isdongle(peasycap);
-/*---------------------------------------------------------------------------*/
-/*
- * FREE VIDEO.
- */
-/*---------------------------------------------------------------------------*/
+
+ /* Free video urbs */
if (peasycap->purb_video_head) {
m = 0;
list_for_each(plist_head, peasycap->purb_video_head) {
}
JOM(4, "%i video urbs freed\n", m);
-/*---------------------------------------------------------------------------*/
JOM(4, "freeing video data_urb structures.\n");
m = 0;
list_for_each_safe(plist_head, plist_next,
JOM(4, "setting peasycap->purb_video_head=NULL\n");
peasycap->purb_video_head = NULL;
}
-/*---------------------------------------------------------------------------*/
+
+ /* Free video isoc buffers */
JOM(4, "freeing video isoc buffers.\n");
m = 0;
for (k = 0; k < VIDEO_ISOC_BUFFER_MANY; k++) {
}
JOM(4, "isoc video buffers freed: %i pages\n",
m * (0x01 << VIDEO_ISOC_ORDER));
-/*---------------------------------------------------------------------------*/
+ /* Free video field buffers */
JOM(4, "freeing video field buffers.\n");
gone = 0;
for (k = 0; k < FIELD_BUFFER_MANY; k++) {
}
}
JOM(4, "video field buffers freed: %i pages\n", gone);
-/*---------------------------------------------------------------------------*/
+
+ /* Free video frame buffers */
JOM(4, "freeing video frame buffers.\n");
gone = 0;
for (k = 0; k < FRAME_BUFFER_MANY; k++) {
}
}
JOM(4, "video frame buffers freed: %i pages\n", gone);
-/*---------------------------------------------------------------------------*/
-/*
- * FREE AUDIO.
- */
-/*---------------------------------------------------------------------------*/
+
+ /* Free audio urbs */
if (peasycap->purb_audio_head) {
JOM(4, "freeing audio urbs\n");
m = 0;
}
}
JOM(4, "%i audio urbs freed\n", m);
-/*---------------------------------------------------------------------------*/
JOM(4, "freeing audio data_urb structures.\n");
m = 0;
list_for_each_safe(plist_head, plist_next,
JOM(4, "setting peasycap->purb_audio_head=NULL\n");
peasycap->purb_audio_head = NULL;
}
-/*---------------------------------------------------------------------------*/
+
+ /* Free audio isoc buffers */
JOM(4, "freeing audio isoc buffers.\n");
m = 0;
for (k = 0; k < AUDIO_ISOC_BUFFER_MANY; k++) {
}
JOM(4, "easyoss_delete(): isoc audio buffers freed: %i pages\n",
m * (0x01 << AUDIO_ISOC_ORDER));
-/*---------------------------------------------------------------------------*/
JOM(4, "freeing easycap structure.\n");
allocation_video_urb = peasycap->allocation_video_urb;
allocation_video_page = peasycap->allocation_video_page;
kfree(peasycap);
-/*---------------------------------------------------------------------------*/
SAY("%8i=video urbs after all deletions\n", allocation_video_urb);
SAY("%8i=video pages after all deletions\n", allocation_video_page);
SAY("%8i=video structs after all deletions\n", allocation_video_struct);