Blob Blame History Raw
From bcf87ea6e2d08eab75ba2aa53336a630421becfb Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman@linux.intel.com>
Date: Thu, 23 Jul 2020 17:45:09 +0300
Subject: [PATCH] xhci: dbc: Remove dbc_dma_free_coherent() wrapper
Git-commit: bcf87ea6e2d08eab75ba2aa53336a630421becfb
References: jsc#SLE-14911
Patch-mainline: v5.9-rc1

dbc_dma_free_coherent() takes struct xhci_hcd pointer as a parameter, but
does nothing more than calls dma_free_coherent().
Remove it and call dma_free_coherent() directly instead.

No functional changes
This change helps decoupling xhci and DbC

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200723144530.9992-7-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/host/xhci-dbgcap.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c
index e8a2cbda135c..5bec36ed97c6 100644
--- a/drivers/usb/host/xhci-dbgcap.c
+++ b/drivers/usb/host/xhci-dbgcap.c
@@ -14,15 +14,6 @@
 #include "xhci-trace.h"
 #include "xhci-dbgcap.h"
 
-static inline void
-dbc_dma_free_coherent(struct xhci_hcd *xhci, size_t size,
-		      void *cpu_addr, dma_addr_t dma_handle)
-{
-	if (cpu_addr)
-		dma_free_coherent(xhci_to_hcd(xhci)->self.sysdev,
-				  size, cpu_addr, dma_handle);
-}
-
 static u32 xhci_dbc_populate_strings(struct dbc_str_descs *strings)
 {
 	struct usb_string_descriptor	*s_desc;
@@ -465,9 +456,8 @@ static void xhci_dbc_mem_cleanup(struct xhci_hcd *xhci)
 	xhci_dbc_eps_exit(xhci);
 
 	if (dbc->string) {
-		dbc_dma_free_coherent(xhci,
-				      dbc->string_size,
-				      dbc->string, dbc->string_dma);
+		dma_free_coherent(dbc->dev, dbc->string_size,
+				  dbc->string, dbc->string_dma);
 		dbc->string = NULL;
 	}
 
-- 
2.26.2