Messages in this thread Patch in this message | | | Date | Tue, 6 Oct 2020 22:29:03 +0200 | From | Leonid Kushnir <> | Subject | [PATCH 3/3] 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.
Signed-off-by: Leonid Kushnir <leonf008@gmail.com> --- drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 7 ++++--- 1 file 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); } /* -- 2.25.1
| |