[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZgF6zvaT2OkrbkHK@hovoldconsulting.com>
Date: Mon, 25 Mar 2024 14:23:26 +0100
From: Johan Hovold <johan@...nel.org>
To: Krishna Kurapati PSSNV <quic_kriskura@...cinc.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Wesley Cheng <quic_wcheng@...cinc.com>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Conor Dooley <conor+dt@...nel.org>,
Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
Felipe Balbi <balbi@...nel.org>, devicetree@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, quic_ppratap@...cinc.com,
quic_jackp@...cinc.com
Subject: Re: [PATCH v16 7/9] usb: dwc3: qcom: Refactor IRQ handling in glue
driver
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.
I meant that you should return whatever error dwc3_qcom_find_num_ports()
returns, so perhaps something like:
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.
Johan
Powered by blists - more mailing lists