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>
This commit is contained in:
Родитель
b6155eaf6b
Коммит
b89bffa2ef
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче