/* Initialize v4l2 variables and prepare v4l2 devices */ int ivtv_streams_setup(struct ivtv *itv) { int type; /* Setup V4L2 Devices */ for (type = 0; type < IVTV_MAX_STREAMS; type++) { /* Prepare device */ if (ivtv_prep_dev(itv, type)) break; if (itv->streams[type].vdev == NULL) continue; /* Allocate Stream */ if (ivtv_stream_alloc(&itv->streams[type])) break; } if (type == IVTV_MAX_STREAMS) return 0; /* One or more streams could not be initialized. Clean 'em all up. */ ivtv_streams_cleanup(itv, 0); return -ENOMEM; }
int ivtv_streams_setup(struct ivtv *itv) { int type; /* */ for (type = 0; type < IVTV_MAX_STREAMS; type++) { /* */ if (ivtv_prep_dev(itv, type)) break; if (itv->streams[type].vdev == NULL) continue; /* */ if (ivtv_stream_alloc(&itv->streams[type])) break; } if (type == IVTV_MAX_STREAMS) return 0; /* */ ivtv_streams_cleanup(itv, 0); return -ENOMEM; }