1
0
Fork 0

typec: tcpm: Fix a msecs vs jiffies bug

The tcpm_set_state() function take msecs not jiffies.

Fixes: f0690a25a1 ("staging: typec: USB Type-C Port Manager (tcpm)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Carpenter 2018-06-07 16:17:14 +03:00 committed by Greg Kroah-Hartman
parent ecc443c03f
commit 9578bcd0bb

View file

@ -3043,7 +3043,8 @@ static void run_state_machine(struct tcpm_port *port)
tcpm_port_is_sink(port) &&
time_is_after_jiffies(port->delayed_runtime)) {
tcpm_set_state(port, SNK_DISCOVERY,
port->delayed_runtime - jiffies);
jiffies_to_msecs(port->delayed_runtime -
jiffies));
break;
}
tcpm_set_state(port, unattached_state(port), 0);