lkml.org 
[lkml]   [2021]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] gnss: ubx: Simplify the return expression in the ubx.c
Date
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

\
 
 \ /
  Last update: 2021-02-24 10:52    [W:0.064 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site