Re: [PATCH v16 7/9] usb: dwc3: qcom: Refactor IRQ handling in glue driver

From: Krishna Kurapati PSSNV
Date: Tue Mar 26 2024 - 04:12:18 EST




On 3/26/2024 1:15 AM, Johan Hovold wrote:

Just change the logic in dwc3_qcom_find_num_ports() so that it returns 1
if "dp_hs_phy_1" is missing, and otherwise you determine the number of
ports by iterating from 2 to DWC3_MAX_PORTS - 1.

Hi Johan,

I made this change and it works. Removed any return value check for the find_num_ports call as it can return only 1/2/3/4 now.

---
irq = platform_get_irq_byname_optional(pdev, "qusb2_phy");
if (irq > 0)
return 1;

irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_irq");
if (irq > 0)
return 1;

irq = platform_get_irq_byname_optional(pdev, "dp_hs_phy_1");
if (irq <= 0)
return 1;

for (port_index = 1; port_index < DWC3_MAX_PORTS - 1; port_index++) {
sprintf(irq_name, "dp_hs_phy_%d", port_index + 1);

irq = platform_get_irq_byname_optional(pdev, irq_name);
if (irq <= 0)
return port_index;
}

return DWC3_MAX_PORTS;

---

Let me know if this is fine and I can push out v17.

Regards,
Krishna,