/* Unregister v4l2 devices */ void ivtv_streams_cleanup(struct ivtv *itv, int unregister) { int type; /* Teardown all streams */ for (type = 0; type < IVTV_MAX_STREAMS; type++) { struct video_device *vdev = itv->streams[type].vdev; itv->streams[type].vdev = NULL; if (vdev == NULL) continue; ivtv_stream_free(&itv->streams[type]); /* Unregister or release device */ if (unregister) video_unregister_device(vdev); else video_device_release(vdev); } }
/* Unregister v4l2 devices */ void ivtv_streams_cleanup(struct ivtv *itv) { int type; /* Teardown all streams */ for (type = 0; type < IVTV_MAX_STREAMS; type++) { struct video_device *vdev = itv->streams[type].v4l2dev; itv->streams[type].v4l2dev = NULL; if (vdev == NULL) continue; ivtv_stream_free(&itv->streams[type]); /* Free Device */ if (vdev->minor == -1) /* 'Hidden' never registered stream (OSD) */ video_device_release(vdev); else /* All others, just unregister. */ video_unregister_device(vdev); } }