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

From: Krishna Kurapati PSSNV
Date: Mon Mar 25 2024 - 14:09:28 EST




On 3/25/2024 6:53 PM, Johan Hovold wrote:
On Mon, Mar 25, 2024 at 06:45:07PM +0530, Krishna Kurapati PSSNV wrote:
+static int dwc3_qcom_setup_irq(struct platform_device *pdev)
+{
+ struct dwc3_qcom *qcom = platform_get_drvdata(pdev);
+ bool is_multiport;
+ int ret;
+ int i;
+
+ qcom->num_ports = dwc3_qcom_find_num_ports(pdev);
+ if (qcom->num_ports < 0)
+ return -ENOMEM;

Just return 'ret' directly.

Sure, will init ret to -ENOMEM and return ret here. >
Hi Johan,

I meant that you should return whatever error dwc3_qcom_find_num_ports()
returns, so perhaps something like:


Got it. Any error that might come up in interrupt reading as well.

ret = dwc3_qcom_find_num_ports(pdev);
if (ret < 0)
return ret;

qcom->num_ports = ret;

It looks like dwc3_qcom_find_num_ports() can also return 0 (e.g. on
malformed DT), which also needs to be handled somehow. I missed that
earlier.


From what I remember, Konrad mentioned that we might not need to support incomplete or improper DT [1]. Also since this is close to getting merged, can we take up any changes for Malformed DT handling later given that only one or two devices are present and less likely to be given a malformed DT.

[1]: https://lore.kernel.org/all/c8d77d4f-6696-4dc9-8030-daf1d10b114b@xxxxxxxxxx/

Regards,
Krishna,