From 3cc289a699f9797d994179ae542a6d305251244b Mon Sep 17 00:00:00 2001 From: Nolen Johnson Date: Tue, 21 Dec 2021 14:47:24 -0500 Subject: [PATCH] usb: typec: tcpm: Unconditionally return port->current_limit * For the function `tcpm_psy_get_current_max`, normally we compare max of `port->current_limit` and `tcpm_get_max_fixed_current(port)`, but `tcpm_get_max_fixed_current` is guarded by a messy DEBUGFS config check. So, lets play it safe and assume that the port's limit is the limit. Change-Id: I9df703cd47f3a94b723b861fbfae0aabf13fb92c --- drivers/usb/typec/tcpm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 41c394e0c9bf..e939f850fb0d 100644 --- a/drivers/usb/typec/tcpm.c +++ b/drivers/usb/typec/tcpm.c @@ -4638,9 +4638,7 @@ static int tcpm_psy_get_current_max(struct tcpm_port *port, if (port->pps_data.active) val->intval = port->pps_data.max_curr * 1000; else - val->intval = max_t(size_t, tcpm_get_max_fixed_current(port), - port->current_limit) * 1000; - + val->intval = port->current_limit * 1000; return 0; } -- 2.20.1