usb: dwc2: gadget: use existing helper
authorJohn Keeping <john@metanate.com>
Mon, 22 Nov 2021 12:31:07 +0000 (12:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Nov 2021 13:13:04 +0000 (14:13 +0100)
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.

Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/20211122123107.3147353-1-john@metanate.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/gadget.c

index 4ab4a1d5062b2a0ebeecf5c0b77ef3537d1f25e6..976edcf2d156bad335134e42e2dac6eab24e2be9 100644 (file)
@@ -5206,7 +5206,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));
@@ -5218,7 +5218,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));