summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-11-03 20:28:24 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-12-03 17:53:02 -0200
commit2b16b44a1c44814ed00cf750d20f3c404b5d4e48 (patch)
tree5564e4a7b13e81eb4aa2411755528b343fd05e7b
parent245d6b2d505b0575b34e5c02b694bf2e476904b4 (diff)
[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: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/staging/media/omap4iss/iss.c20
-rw-r--r--drivers/staging/media/omap4iss/iss_video.c15
2 files changed, 17 insertions, 18 deletions
diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
index 7d427d541fd..b7c8a6bc7d8 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -887,24 +887,22 @@ void omap4iss_isp_subclk_disable(struct iss_device *iss,
*/
static int iss_enable_clocks(struct iss_device *iss)
{
- int r;
+ int ret;
- r = clk_enable(iss->iss_fck);
- if (r) {
+ ret = clk_enable(iss->iss_fck);
+ if (ret) {
dev_err(iss->dev, "clk_enable iss_fck failed\n");
- return r;
+ return ret;
}
- r = clk_enable(iss->iss_ctrlclk);
- if (r) {
+ ret = clk_enable(iss->iss_ctrlclk);
+ if (ret) {
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:
- clk_disable(iss->iss_fck);
- return r;
+ return 0;
}
/*
diff --git a/drivers/staging/media/omap4iss/iss_video.c b/drivers/staging/media/omap4iss/iss_video.c
index ccbdecd0114..a527330abc3 100644
--- a/drivers/staging/media/omap4iss/iss_video.c
+++ b/drivers/staging/media/omap4iss/iss_video.c
@@ -826,16 +826,17 @@ iss_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
spin_unlock_irqrestore(&video->qlock, flags);
}
- if (ret < 0) {
+ mutex_unlock(&video->stream_lock);
+ return 0;
+
err_omap4iss_set_stream:
- vb2_streamoff(&vfh->queue, type);
+ vb2_streamoff(&vfh->queue, type);
err_iss_video_check_format:
- media_entity_pipeline_stop(&video->video.entity);
+ media_entity_pipeline_stop(&video->video.entity);
err_media_entity_pipeline_start:
- if (video->iss->pdata->set_constraints)
- video->iss->pdata->set_constraints(video->iss, false);
- video->queue = NULL;
- }
+ if (video->iss->pdata->set_constraints)
+ video->iss->pdata->set_constraints(video->iss, false);
+ video->queue = NULL;
mutex_unlock(&video->stream_lock);
return ret;