Commit dfe59c78 authored by Leonid Kushnir's avatar Leonid Kushnir Committed by Mauro Carvalho Chehab

media: staging: atomisp: Corrected error handling in function

This patch fixes check of a result of 'power_up()' function call in
function 'gc0310_s_power()' to do "error handling" instead of "success
handling" as Dan Carpenter noted in his comment on the previous patch.
Lines 'return gc0310_init(sd)' and 'return ret' are swapped, and direct
value of 'ret' is checked in IF statement now.

Link: https://lore.kernel.org/linux-media/20201006202903.GA8346@linuxSigned-off-by: default avatarLeonid Kushnir <leonf008@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 4658e1db
......@@ -874,11 +874,12 @@ static int gc0310_s_power(struct v4l2_subdev *sd, int on)
if (on == 0)
return power_down(sd);
ret = power_up(sd);
if (!ret)
return gc0310_init(sd);
if (ret)
return ret;
return ret;
return gc0310_init(sd);
}
/*
......
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