[PATCH linux-next v2] usb: typec: tcpm: tcpci: Remove the unneeded result variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: xupanda <xu.panda@xxxxxxxxxx>

Return the value regmap_update_bits() directly instead of
storing it in another redundant variable.

Reported-by: Zeal Robot <zeal@xxxxxxxxxx>
Signed-off-by: xupanda <xu.panda@xxxxxxxxxx>

---
change for v2
 - remove those irrelevant sentences 
---

 drivers/usb/typec/tcpm/tcpci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index b2bfcebe218f..29047da826a9 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,
+	return regmap_update_bits(tcpci->regmap, TCPC_POWER_CTRL, TCPC_POWER_CTRL_AUTO_DISCHARGE,
 				 enable ? TCPC_POWER_CTRL_AUTO_DISCHARGE : 0);
-	return ret;
 }
 
 static int tcpci_set_auto_vbus_discharge_threshold(struct tcpc_dev *dev, enum typec_pwr_opmode mode,
-- 
2.25.1




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux