Commit 2b16b44a authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: omap4iss: Simplify error paths

Get rid of a goto statement for a simple error path that can be inlined,
and split spaghetti error code to a separate section.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 245d6b2d
...@@ -887,24 +887,22 @@ void omap4iss_isp_subclk_disable(struct iss_device *iss, ...@@ -887,24 +887,22 @@ void omap4iss_isp_subclk_disable(struct iss_device *iss,
*/ */
static int iss_enable_clocks(struct iss_device *iss) static int iss_enable_clocks(struct iss_device *iss)
{ {
int r; int ret;
r = clk_enable(iss->iss_fck); ret = clk_enable(iss->iss_fck);
if (r) { if (ret) {
dev_err(iss->dev, "clk_enable iss_fck failed\n"); dev_err(iss->dev, "clk_enable iss_fck failed\n");
return r; return ret;
} }
r = clk_enable(iss->iss_ctrlclk); ret = clk_enable(iss->iss_ctrlclk);
if (r) { if (ret) {
dev_err(iss->dev, "clk_enable iss_ctrlclk failed\n"); dev_err(iss->dev, "clk_enable iss_ctrlclk failed\n");
goto out_clk_enable_ctrlclk; clk_disable(iss->iss_fck);
return ret;
} }
return 0;
out_clk_enable_ctrlclk: return 0;
clk_disable(iss->iss_fck);
return r;
} }
/* /*
......
...@@ -826,16 +826,17 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type) ...@@ -826,16 +826,17 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
spin_unlock_irqrestore(&video->qlock, flags); spin_unlock_irqrestore(&video->qlock, flags);
} }
if (ret < 0) { mutex_unlock(&video->stream_lock);
return 0;
err_omap4iss_set_stream: err_omap4iss_set_stream:
vb2_streamoff(&vfh->queue, type); vb2_streamoff(&vfh->queue, type);
err_iss_video_check_format: err_iss_video_check_format:
media_entity_pipeline_stop(&video->video.entity); media_entity_pipeline_stop(&video->video.entity);
err_media_entity_pipeline_start: err_media_entity_pipeline_start:
if (video->iss->pdata->set_constraints) if (video->iss->pdata->set_constraints)
video->iss->pdata->set_constraints(video->iss, false); video->iss->pdata->set_constraints(video->iss, false);
video->queue = NULL; video->queue = NULL;
}
mutex_unlock(&video->stream_lock); mutex_unlock(&video->stream_lock);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment