Skip to contentSkip to conversation

gnss: simplify the return expression of ubx_set functions

PATCH New Qinglang Miao 1 participant 1 message Sep 21, 2020 Gnss

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gnss: simplify the return expression of ubx_set functions

Simplify the return expression.

---
 drivers/gnss/ubx.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/gnss/ubx.c +2 -12
index 7b05bc405..7a22fc901 100644
@@ -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,
Signature · 1 line
2.23.0