int vb2_fop_release(struct file *file) { struct video_device *vdev = video_devdata(file); struct mutex *lock = vdev->queue->lock ? vdev->queue->lock : vdev->lock; return _vb2_fop_release(file, lock); }
static int fimc_lite_release(struct file *file) { struct fimc_lite *fimc = video_drvdata(file); struct media_entity *entity = &fimc->ve.vdev.entity; mutex_lock(&fimc->lock); if (v4l2_fh_is_singular_file(file) && atomic_read(&fimc->out_path) == FIMC_IO_DMA) { if (fimc->streaming) { media_entity_pipeline_stop(entity); fimc->streaming = false; } fimc_lite_stop_capture(fimc, false); fimc_pipeline_call(&fimc->ve, close); clear_bit(ST_FLITE_IN_USE, &fimc->state); mutex_lock(&entity->parent->graph_mutex); entity->use_count--; mutex_unlock(&entity->parent->graph_mutex); } _vb2_fop_release(file, NULL); pm_runtime_put(&fimc->pdev->dev); clear_bit(ST_FLITE_SUSPENDED, &fimc->state); mutex_unlock(&fimc->lock); return 0; }
static int rvin_release(struct file *file) { struct rvin_dev *vin = video_drvdata(file); bool fh_singular; int ret; mutex_lock(&vin->lock); /* Save the singular status before we call the clean-up helper */ fh_singular = v4l2_fh_is_singular_file(file); /* the release helper will cleanup any on-going streaming */ ret = _vb2_fop_release(file, NULL); /* * If this was the last open file. * Then de-initialize hw module. */ if (fh_singular) { pm_runtime_suspend(&vin->vdev.dev); pm_runtime_disable(&vin->vdev.dev); rvin_power_off(vin); } mutex_unlock(&vin->lock); return ret; }
static int rvin_mc_release(struct file *file) { struct rvin_dev *vin = video_drvdata(file); int ret; mutex_lock(&vin->lock); /* the release helper will cleanup any on-going streaming. */ ret = _vb2_fop_release(file, NULL); v4l2_pipeline_pm_use(&vin->vdev.entity, 0); pm_runtime_put(vin->dev); mutex_unlock(&vin->lock); return ret; }