summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/davinci/vpbe.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-10-12 04:54:26 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-16 12:40:32 -0200
commit837fdcf05af645c3961cae69fd188a0fee1add52 (patch)
tree320864ef6b39002501b9b0792bea2bc31635fc61 /drivers/media/platform/davinci/vpbe.c
parentca7948aa85290f55b8929a8c028352913167bca3 (diff)
downloadlinux-837fdcf05af645c3961cae69fd188a0fee1add52.tar.bz2
[media] DaVinci-VPBE: Reduce the scope for a variable in vpbe_set_default_output()
* Move the definition for the variable "ret" into an if branch so that an extra initialisation can be avoided at the beginning by this refactoring. * Return a success code as a constant at the end. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/davinci/vpbe.c')
-rw-r--r--drivers/media/platform/davinci/vpbe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
index 50b9e3df68b5..77b3365b71ef 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -297,19 +297,19 @@ out:
static int vpbe_set_default_output(struct vpbe_device *vpbe_dev)
{
struct vpbe_config *cfg = vpbe_dev->cfg;
- int ret = 0;
int i;
for (i = 0; i < cfg->num_outputs; i++) {
if (!strcmp(def_output,
cfg->outputs[i].output.name)) {
- ret = vpbe_set_output(vpbe_dev, i);
+ int ret = vpbe_set_output(vpbe_dev, i);
+
if (!ret)
vpbe_dev->current_out_index = i;
return ret;
}
}
- return ret;
+ return 0;
}
/**