提交 6aafb003 编写于 作者: M Matthijs Kooijman 提交者: Greg Kroah-Hartman

staging: dwc2: use irq_return_t for interrupt handlers

The top-level hcd interrupt handlers already used irq_return_t, but the
functions to which it delegates the actual work and the common irq
handler returned plain ints. In addition, they used the IRQ_RETVAL in
the wrong way (but because of the values of the various constants, this
didn't result in wrong behaviour).
Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
[matthijs@stdin.nl: Split patch from bigger patch and added commit message]
Signed-off-by: NMatthijs Kooijman <matthijs@stdin.nl>
Acked-by: NPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 66513f49
...@@ -450,7 +450,7 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev) ...@@ -450,7 +450,7 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev)
{ {
struct dwc2_hsotg *hsotg = dev; struct dwc2_hsotg *hsotg = dev;
u32 gintsts; u32 gintsts;
int retval = 0; irqreturn_t retval = IRQ_NONE;
if (dwc2_check_core_status(hsotg) < 0) { if (dwc2_check_core_status(hsotg) < 0) {
dev_warn(hsotg->dev, "Controller is disconnected\n"); dev_warn(hsotg->dev, "Controller is disconnected\n");
...@@ -461,7 +461,7 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev) ...@@ -461,7 +461,7 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev)
gintsts = dwc2_read_common_intr(hsotg); gintsts = dwc2_read_common_intr(hsotg);
if (gintsts & ~GINTSTS_PRTINT) if (gintsts & ~GINTSTS_PRTINT)
retval = 1; retval = IRQ_HANDLED;
if (gintsts & GINTSTS_MODEMIS) if (gintsts & GINTSTS_MODEMIS)
dwc2_handle_mode_mismatch_intr(hsotg); dwc2_handle_mode_mismatch_intr(hsotg);
...@@ -500,6 +500,6 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev) ...@@ -500,6 +500,6 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev)
spin_unlock(&hsotg->lock); spin_unlock(&hsotg->lock);
out: out:
return IRQ_RETVAL(retval); return retval;
} }
EXPORT_SYMBOL_GPL(dwc2_handle_common_intr); EXPORT_SYMBOL_GPL(dwc2_handle_common_intr);
...@@ -2533,9 +2533,8 @@ static void _dwc2_hcd_endpoint_reset(struct usb_hcd *hcd, ...@@ -2533,9 +2533,8 @@ static void _dwc2_hcd_endpoint_reset(struct usb_hcd *hcd,
static irqreturn_t _dwc2_hcd_irq(struct usb_hcd *hcd) static irqreturn_t _dwc2_hcd_irq(struct usb_hcd *hcd)
{ {
struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
int retval = dwc2_hcd_intr(hsotg);
return IRQ_RETVAL(retval); return dwc2_hcd_intr(hsotg);
} }
/* /*
......
...@@ -650,10 +650,10 @@ extern void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg, ...@@ -650,10 +650,10 @@ extern void dwc2_hcd_save_data_toggle(struct dwc2_hsotg *hsotg,
* *
* @hsotg: The DWC2 HCD * @hsotg: The DWC2 HCD
* *
* Returns non zero if interrupt is handled * Returns IRQ_HANDLED if interrupt is handled
* Return 0 if interrupt is not handled * Return IRQ_NONE if interrupt is not handled
*/ */
extern int dwc2_hcd_intr(struct dwc2_hsotg *hsotg); extern irqreturn_t dwc2_hcd_intr(struct dwc2_hsotg *hsotg);
/** /**
* dwc2_hcd_stop() - Halts the DWC_otg host mode operation * dwc2_hcd_stop() - Halts the DWC_otg host mode operation
......
...@@ -2062,14 +2062,14 @@ static void dwc2_hc_intr(struct dwc2_hsotg *hsotg) ...@@ -2062,14 +2062,14 @@ static void dwc2_hc_intr(struct dwc2_hsotg *hsotg)
} }
/* This function handles interrupts for the HCD */ /* This function handles interrupts for the HCD */
int dwc2_hcd_intr(struct dwc2_hsotg *hsotg) irqreturn_t dwc2_hcd_intr(struct dwc2_hsotg *hsotg)
{ {
u32 gintsts, dbg_gintsts; u32 gintsts, dbg_gintsts;
int retval = 0; irqreturn_t retval = IRQ_NONE;
if (dwc2_check_core_status(hsotg) < 0) { if (dwc2_check_core_status(hsotg) < 0) {
dev_warn(hsotg->dev, "Controller is disconnected\n"); dev_warn(hsotg->dev, "Controller is disconnected\n");
return 0; return retval;
} }
spin_lock(&hsotg->lock); spin_lock(&hsotg->lock);
...@@ -2079,10 +2079,10 @@ int dwc2_hcd_intr(struct dwc2_hsotg *hsotg) ...@@ -2079,10 +2079,10 @@ int dwc2_hcd_intr(struct dwc2_hsotg *hsotg)
gintsts = dwc2_read_core_intr(hsotg); gintsts = dwc2_read_core_intr(hsotg);
if (!gintsts) { if (!gintsts) {
spin_unlock(&hsotg->lock); spin_unlock(&hsotg->lock);
return 0; return retval;
} }
retval = 1; retval = IRQ_HANDLED;
dbg_gintsts = gintsts; dbg_gintsts = gintsts;
#ifndef DEBUG_SOF #ifndef DEBUG_SOF
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册