[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220829030442.264695-1-xu.panda@zte.com.cn>
Date: Mon, 29 Aug 2022 03:04:43 +0000
From: cgel.zte@...il.com
To: linux@...ck-us.net
Cc: heikki.krogerus@...ux.intel.com, gregkh@...uxfoundation.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
xupanda <xu.panda@....com.cn>, Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next v3] usb: typec: tcpm: tcpci: Remove the unneeded result variable
From: xupanda <xu.panda@....com.cn>
Return the value regmap_update_bits() directly instead of
storing it in another redundant variable.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: xupanda <xu.panda@....com.cn>
---
chang for v3
- re-align continuation line alignment
---
drivers/usb/typec/tcpm/tcpci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index b2bfcebe218f..cd243530264b 100644
--- a/drivers/usb/typec/tcpm/tcpci.c
+++ b/drivers/usb/typec/tcpm/tcpci.c
@@ -328,11 +328,9 @@ static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable)
static int tcpci_enable_auto_vbus_discharge(struct tcpc_dev *dev, bool enable)
{
struct tcpci *tcpci = tcpc_to_tcpci(dev);
- int ret;
- ret = regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, TCPC_POWER_CTRL_AUTO_DISCHARGE,
- enable ? TCPC_POWER_CTRL_AUTO_DISCHARGE : 0);
- return ret;
+ return regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, TCPC_POWER_CTRL_AUTO_DISCHARGE,
+ enable ? TCPC_POWER_CTRL_AUTO_DISCHARGE : 0);
}
static int tcpci_set_auto_vbus_discharge_threshold(struct tcpc_dev *dev, enum typec_pwr_opmode mode,
--
2.25.1
Powered by blists - more mailing lists