Commit b89bffa2 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

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: default avatarMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: default avatarAndrew Halaney <ahalaney@redhat.com>
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220805074500.21469-2-johan+linaro@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6155eaf
...@@ -244,6 +244,7 @@ static int dwc3_qcom_interconnect_disable(struct dwc3_qcom *qcom) ...@@ -244,6 +244,7 @@ static int dwc3_qcom_interconnect_disable(struct dwc3_qcom *qcom)
*/ */
static int dwc3_qcom_interconnect_init(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; struct device *dev = qcom->dev;
int ret; int ret;
...@@ -264,8 +265,8 @@ static int dwc3_qcom_interconnect_init(struct dwc3_qcom *qcom) ...@@ -264,8 +265,8 @@ static int dwc3_qcom_interconnect_init(struct dwc3_qcom *qcom)
return PTR_ERR(qcom->icc_path_apps); return PTR_ERR(qcom->icc_path_apps);
} }
if (usb_get_maximum_speed(&qcom->dwc3->dev) >= USB_SPEED_SUPER || max_speed = usb_get_maximum_speed(&qcom->dwc3->dev);
usb_get_maximum_speed(&qcom->dwc3->dev) == USB_SPEED_UNKNOWN) if (max_speed >= USB_SPEED_SUPER || max_speed == USB_SPEED_UNKNOWN)
ret = icc_set_bw(qcom->icc_path_ddr, ret = icc_set_bw(qcom->icc_path_ddr,
USB_MEMORY_AVG_SS_BW, USB_MEMORY_PEAK_SS_BW); USB_MEMORY_AVG_SS_BW, USB_MEMORY_PEAK_SS_BW);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment