[RFC PATCH 29/41] staging: dwc2: use functions to disable interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This piece of code manually disabled interrupts, while there are
perfectly good functions to do this.

Technically, the old code really disabled _all_ interrupts, while the
new code only disables a specific list of interrupts, but that list of
interrupts includes all interrupts that are ever enabled, so the result
should be the same.

Signed-off-by: Matthijs Kooijman <matthijs@xxxxxxxx>
---
 drivers/staging/dwc2/hcd.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c
index 01e7eb1..3656a3c 100644
--- a/drivers/staging/dwc2/hcd.c
+++ b/drivers/staging/dwc2/hcd.c
@@ -2606,7 +2606,6 @@ static struct hc_driver dwc2_hc_driver = {
  */
 static void dwc2_hcd_free(struct dwc2_hsotg *hsotg)
 {
-	u32 ahbcfg;
 	u32 dctl;
 	int i;
 
@@ -2644,12 +2643,10 @@ static void dwc2_hcd_free(struct dwc2_hsotg *hsotg)
 		hsotg->status_buf = NULL;
 	}
 
-	ahbcfg = readl(hsotg->regs + GAHBCFG);
-
 	/* Disable all interrupts */
-	ahbcfg &= ~GAHBCFG_GLBL_INTR_EN;
-	writel(ahbcfg, hsotg->regs + GAHBCFG);
-	writel(0, hsotg->regs + GINTMSK);
+	dwc2_disable_global_interrupts(hsotg);
+	dwc2_disable_host_interrupts(hsotg);
+	dwc2_disable_common_interrupts(hsotg);
 
 	if (hsotg->hw_params.snpsid >= DWC2_CORE_REV_3_00a) {
 		dctl = readl(hsotg->regs + DCTL);
-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux