[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211022110045.11044-1-dingsenjie@163.com>
Date: Fri, 22 Oct 2021 19:00:45 +0800
From: dingsenjie@....com
To: linux@...ck-us.net, heikki.krogerus@...ux.intel.com,
gregkh@...uxfoundation.org
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
dingsenjie <dingsenjie@...ong.com>
Subject: [PATCH] usb: tcpm: Simplify the return expression of tcpm_start_toggling
From: dingsenjie <dingsenjie@...ong.com>
Simplify the return expression in the tcpm.c
Signed-off-by: dingsenjie <dingsenjie@...ong.com>
---
drivers/usb/typec/tcpm/tcpm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index 22a85b396f69..dabe694a7eb1 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -2766,14 +2766,11 @@ static int tcpm_set_charge(struct tcpm_port *port, bool charge)
static bool tcpm_start_toggling(struct tcpm_port *port, enum typec_cc_status cc)
{
- int ret;
-
if (!port->tcpc->start_toggling)
return false;
tcpm_log_force(port, "Start toggling");
- ret = port->tcpc->start_toggling(port->tcpc, port->port_type, cc);
- return ret == 0;
+ return port->tcpc->start_toggling(port->tcpc, port->port_type, cc) == 0;
}
static void tcpm_set_cc(struct tcpm_port *port, enum typec_cc_status cc)
--
2.29.0
Powered by blists - more mailing lists