aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <johan+linaro@kernel.org>2022-08-05 09:44:59 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-19 11:04:58 +0200
commitb89bffa2efc9cee72454cae1ae08a8b437717b35 (patch)
treeec5ac5326ecb57876838114c75b37f5a49287483
parentusb: common: debug: Check non-standard control requests (diff)
downloadlinux-dev-b89bffa2efc9cee72454cae1ae08a8b437717b35.tar.xz
linux-dev-b89bffa2efc9cee72454cae1ae08a8b437717b35.zip
usb: dwc3: qcom: only parse 'maximum-speed' once
Add a temporary variable to the interconnect-initialisation helper to avoid parsing and decoding the 'maximum-speed' devicetree property twice. Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20220805074500.21469-2-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/dwc3/dwc3-qcom.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index c5e482f53e9d..f5f38002b751 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -244,6 +244,7 @@ static int dwc3_qcom_interconnect_disable(struct dwc3_qcom *qcom)
*/
static int dwc3_qcom_interconnect_init(struct dwc3_qcom *qcom)
{
+ enum usb_device_speed max_speed;
struct device *dev = qcom->dev;
int ret;
@@ -264,8 +265,8 @@ static int dwc3_qcom_interconnect_init(struct dwc3_qcom *qcom)
return PTR_ERR(qcom->icc_path_apps);
}
- if (usb_get_maximum_speed(&qcom->dwc3->dev) >= USB_SPEED_SUPER ||
- usb_get_maximum_speed(&qcom->dwc3->dev) == USB_SPEED_UNKNOWN)
+ max_speed = usb_get_maximum_speed(&qcom->dwc3->dev);
+ if (max_speed >= USB_SPEED_SUPER || max_speed == USB_SPEED_UNKNOWN)
ret = icc_set_bw(qcom->icc_path_ddr,
USB_MEMORY_AVG_SS_BW, USB_MEMORY_PEAK_SS_BW);
else