@@ -1186,21 +1186,14 @@ static int vpfe_initialize_device(struct vpfe_device *vpfe)
static int vpfe_release(struct file *file)
{
struct vpfe_device *vpfe = video_drvdata(file);
- bool fh_singular;
mutex_lock(&vpfe->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 */
- _vb2_fop_release(file, NULL);
-
/*
- * If this was the last open file.
- * Then de-initialize hw module.
+ * The release helper will cleanup any on-going streaming.
+ * If this was the last open file, then de-initialize hw module.
*/
- if (fh_singular)
+ if (_vb2_fop_release(file, NULL))
vpfe_ccdc_close(&vpfe->ccdc, vpfe->pdev);
mutex_unlock(&vpfe->lock);
@@ -537,7 +537,6 @@ static int fimc_capture_release(struct file *file)
{
struct fimc_dev *fimc = video_drvdata(file);
struct fimc_vid_cap *vc = &fimc->vid_cap;
- bool close = v4l2_fh_is_singular_file(file);
dbg("pid: %d, state: 0x%lx", task_pid_nr(current), fimc->state);
@@ -548,9 +547,7 @@ static int fimc_capture_release(struct file *file)
vc->streaming = false;
}
- _vb2_fop_release(file, NULL);
-
- if (close) {
+ if (_vb2_fop_release(file, NULL)) {
clear_bit(ST_CAPT_BUSY, &fimc->state);
fimc_pipeline_call(&vc->ve, close);
clear_bit(ST_CAPT_SUSPENDED, &fimc->state);
@@ -1631,12 +1631,9 @@ out:
static int mcam_v4l_release(struct file *filp)
{
struct mcam_camera *cam = video_drvdata(filp);
- bool last_open;
mutex_lock(&cam->s_mutex);
- last_open = v4l2_fh_is_singular_file(filp);
- _vb2_fop_release(filp, NULL);
- if (last_open) {
+ if (_vb2_fop_release(filp, NULL)) {
mcam_disable_mipi(cam);
mcam_ctlr_power_down(cam);
if (cam->buffer_mode == B_vmalloc && alloc_bufs_at_read)
@@ -1157,12 +1157,9 @@ done_open:
static int sh_vou_release(struct file *file)
{
struct sh_vou_device *vou_dev = video_drvdata(file);
- bool is_last;
mutex_lock(&vou_dev->fop_lock);
- is_last = v4l2_fh_is_singular_file(file);
- _vb2_fop_release(file, NULL);
- if (is_last) {
+ if (_vb2_fop_release(file, NULL)) {
/* Last close */
vou_dev->status = SH_VOU_INITIALISING;
sh_vou_reg_a_set(vou_dev, VOUER, 0, 0x101);