[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230928214827.GC3553829@hu-bjorande-lv.qualcomm.com>
Date: Thu, 28 Sep 2023 14:48:27 -0700
From: Bjorn Andersson <quic_bjorande@...cinc.com>
To: Krishna Kurapati <quic_kriskura@...cinc.com>
CC: Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
"Andy Gross" <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
"Konrad Dybcio" <konrad.dybcio@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Felipe Balbi <balbi@...nel.org>,
Wesley Cheng <quic_wcheng@...cinc.com>,
Johan Hovold <johan@...nel.org>,
Mathias Nyman <mathias.nyman@...el.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <devicetree@...r.kernel.org>,
<quic_pkondeti@...cinc.com>, <quic_ppratap@...cinc.com>,
<quic_jackp@...cinc.com>, <ahalaney@...hat.com>,
<quic_shazhuss@...cinc.com>
Subject: Re: [PATCH v11 07/13] usb: dwc3: qcom: Add helper function to
request threaded IRQ
On Mon, Aug 28, 2023 at 07:00:27PM +0530, Krishna Kurapati wrote:
> Cleanup setup irq call by implementing a new prep_irq helper function
> and using it to request threaded IRQ's.
>
> Signed-off-by: Krishna Kurapati <quic_kriskura@...cinc.com>
> ---
> drivers/usb/dwc3/dwc3-qcom.c | 63 +++++++++++++++++-------------------
> 1 file changed, 30 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 3de43df6bbe8..f14ddc9c541d 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -535,6 +535,24 @@ static int dwc3_qcom_get_irq(struct platform_device *pdev,
> return ret;
> }
>
> +static int dwc3_qcom_prep_irq(struct dwc3_qcom *qcom, char *irq_name,
> + char *disp_name, int irq)
> +{
> + int ret;
> +
> + /* Keep wakeup interrupts disabled until suspend */
> + irq_set_status_flags(irq, IRQ_NOAUTOEN);
> + ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
> + qcom_dwc3_resume_irq,
> + IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> + disp_name, qcom);
> +
> + if (ret)
> + dev_err(qcom->dev, "%s failed: %d\n", irq_name, ret);
> +
> + return ret;
> +}
> +
> static int dwc3_qcom_setup_irq(struct platform_device *pdev)
> {
> struct dwc3_qcom *qcom = platform_get_drvdata(pdev);
> @@ -545,61 +563,40 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
> irq = dwc3_qcom_get_irq(pdev, "hs_phy_irq",
> pdata ? pdata->hs_phy_irq_index : -1);
> if (irq > 0) {
> - /* Keep wakeup interrupts disabled until suspend */
> - irq_set_status_flags(irq, IRQ_NOAUTOEN);
> - ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
> - qcom_dwc3_resume_irq,
> - IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
> - "qcom_dwc3 HS", qcom);
> - if (ret) {
> - dev_err(qcom->dev, "hs_phy_irq failed: %d\n", ret);
> + ret = dwc3_qcom_prep_irq(qcom, "hs_phy_irq",
> + "qcom_dwc3 HS", irq);
Please leave these lines unwrapped.
Nice cleanup.
Reviewed-by: Bjorn Andersson <quic_bjorande@...cinc.com>
Regards,
Bjorn
Powered by blists - more mailing lists