diff options
author | Leonid Kushnir <leonf008@gmail.com> | 2020-10-06 22:29:03 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-03-22 17:41:07 +0100 |
commit | dfe59c78f4cc1924031e1be3120feb3f126da8ed (patch) | |
tree | da8cfd5cd87cccfde2670185bce2e21ace954705 /drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | |
parent | media: staging: atomisp: Removed else branch in function (diff) | |
download | wireguard-linux-dfe59c78f4cc1924031e1be3120feb3f126da8ed.tar.xz wireguard-linux-dfe59c78f4cc1924031e1be3120feb3f126da8ed.zip |
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@linux
Signed-off-by: Leonid Kushnir <leonf008@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/i2c/atomisp-gc0310.c')
-rw-r--r-- | drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c index 8201c15b5769..d170d0adfea4 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c @@ -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); } /* |