From: Leonid Kushnir <leonf008@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: mchehab@kernel.org, sakari.ailus@linux.intel.com,
gregkh@linuxfoundation.org, leonf008@gmail.com,
linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] media: staging: atomisp: Corrected error handling in function
Date: Tue, 6 Oct 2020 22:29:03 +0200 [thread overview]
Message-ID: <20201006202903.GA8346@linux> (raw)
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
next reply other threads:[~2020-10-06 20:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-06 20:29 Leonid Kushnir [this message]
2020-10-17 13:58 ` [PATCH 3/3] media: staging: atomisp: Corrected error handling in function leonf08
2020-10-17 14:02 ` [Outreachy kernel] " Julia Lawall
2020-10-17 14:05 ` Greg KH
2020-10-17 14:49 ` leonf08
2020-10-17 14:59 ` Vaishali Thakkar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201006202903.GA8346@linux \
--to=leonf008@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.