linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: dingsenjie@163.com
To: johan@kernel.org
Cc: linux-kernel@vger.kernel.org, dingsenjie <dingsenjie@yulong.com>
Subject: [PATCH] gnss: ubx: Simplify the return expression in the ubx.c
Date: Wed, 24 Feb 2021 17:29:47 +0800	[thread overview]
Message-ID: <20210224092947.17724-1-dingsenjie@163.com> (raw)

From: dingsenjie <dingsenjie@yulong.com>

Simplify the return expression.

Signed-off-by: dingsenjie <dingsenjie@yulong.com>
---
 drivers/gnss/ubx.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/gnss/ubx.c b/drivers/gnss/ubx.c
index 7b05bc4..7a22fc9 100644
--- a/drivers/gnss/ubx.c
+++ b/drivers/gnss/ubx.c
@@ -24,25 +24,15 @@ struct ubx_data {
 static int ubx_set_active(struct gnss_serial *gserial)
 {
 	struct ubx_data *data = gnss_serial_get_drvdata(gserial);
-	int ret;
 
-	ret = regulator_enable(data->vcc);
-	if (ret)
-		return ret;
-
-	return 0;
+	return regulator_enable(data->vcc);
 }
 
 static int ubx_set_standby(struct gnss_serial *gserial)
 {
 	struct ubx_data *data = gnss_serial_get_drvdata(gserial);
-	int ret;
 
-	ret = regulator_disable(data->vcc);
-	if (ret)
-		return ret;
-
-	return 0;
+	return regulator_disable(data->vcc);
 }
 
 static int ubx_set_power(struct gnss_serial *gserial,
-- 
1.9.1



             reply	other threads:[~2021-02-24  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  9:29 dingsenjie [this message]
2021-02-24  9:38 ` [PATCH] gnss: ubx: Simplify the return expression in the ubx.c Johan Hovold

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=20210224092947.17724-1-dingsenjie@163.com \
    --to=dingsenjie@163.com \
    --cc=dingsenjie@yulong.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).