Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3C57C43463 for ; Mon, 21 Sep 2020 13:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97F0C21789 for ; Mon, 21 Sep 2020 13:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727298AbgIUNKS (ORCPT ); Mon, 21 Sep 2020 09:10:18 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13757 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727238AbgIUNKN (ORCPT ); Mon, 21 Sep 2020 09:10:13 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 5EAA957A65AC674696D2; Mon, 21 Sep 2020 21:10:11 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 21:10:05 +0800 From: Qinglang Miao To: Johan Hovold CC: , Qinglang Miao Subject: [PATCH -next] gnss: simplify the return expression of ubx_set functions Date: Mon, 21 Sep 2020 21:10:29 +0800 Message-ID: <20200921131029.91882-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Simplify the return expression. Signed-off-by: Qinglang Miao --- 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 7b05bc405..7a22fc901 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, -- 2.23.0