Skip to contentSkip to conversation

usb: dwc2: gadget: use existing helper

PATCH In review John Keeping 2 participants 2 messages Nov 22, 2021 – Nov 23, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc2: gadget: use existing helper

All other checks of params.g_dma_desc in this file use the using_desc_dma() helper function. Use that helper in two more places for consistency throughout the file.

---
 drivers/usb/dwc2/gadget.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc2/gadget.c +2 -2
index ab8d7dad9f567..b884a83b26a6e 100644
@@ -5217,7 +5217,7 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup)
 		 * as result BNA interrupt asserted on hibernation exit
 		 * by restoring from saved area.
 		 */
-		if (hsotg->params.g_dma_desc &&
+		if (using_desc_dma(hsotg) &&
 		    (dr->diepctl[i] & DXEPCTL_EPENA))
 			dr->diepdma[i] = hsotg->eps_in[i]->desc_list_dma;
 		dwc2_writel(hsotg, dr->dtxfsiz[i], DPTXFSIZN(i));
@@ -5229,7 +5229,7 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup)
 		 * as result BNA interrupt asserted on hibernation exit
 		 * by restoring from saved area.
 		 */
-		if (hsotg->params.g_dma_desc &&
+		if (using_desc_dma(hsotg) &&
 		    (dr->doepctl[i] & DXEPCTL_EPENA))
 			dr->doepdma[i] = hsotg->eps_out[i]->desc_list_dma;
 		dwc2_writel(hsotg, dr->doepdma[i], DOEPDMA(i));
Signature · 1 line
2.34.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · John Keeping

All other checks of params.g_dma_desc in this file use the using_desc_dma() helper function. Use that helper in two more places for consistency throughout the file.

Quoted 27 lines
---
  drivers/usb/dwc2/gadget.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/dwc2/gadget.c +2 -2
index ab8d7dad9f567..b884a83b26a6e 100644
@@ -5217,7 +5217,7 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup)
  		 * as result BNA interrupt asserted on hibernation exit
  		 * by restoring from saved area.
  		 */
-		if (hsotg->params.g_dma_desc &&
+		if (using_desc_dma(hsotg) &&
  		    (dr->diepctl[i] & DXEPCTL_EPENA))
  			dr->diepdma[i] = hsotg->eps_in[i]->desc_list_dma;
  		dwc2_writel(hsotg, dr->dtxfsiz[i], DPTXFSIZN(i));
@@ -5229,7 +5229,7 @@ int dwc2_restore_device_registers(struct dwc2_hsotg *hsotg, int remote_wakeup)
  		 * as result BNA interrupt asserted on hibernation exit
  		 * by restoring from saved area.
  		 */
-		if (hsotg->params.g_dma_desc &&
+		if (using_desc_dma(hsotg) &&
  		    (dr->doepctl[i] & DXEPCTL_EPENA))
  			dr->doepdma[i] = hsotg->eps_out[i]->desc_list_dma;
  		dwc2_writel(hsotg, dr->doepdma[i], DOEPDMA(i));