Thread (13 messages) 13 messages, 2 authors, 2017-10-11
STALE3176d

[PATCH 1/9] usb: xhci-mtk: use dma_set_mask_and_coherent() in probe function

From: Chunfeng Yun <hidden>
Date: 2017-09-27 09:23:23
Also in: linux-arm-kernel, linux-mediatek, lkml
Subsystem: mediatek usb3 drd ip driver, the rest, usb subsystem, usb xhci driver · Maintainers: Chunfeng Yun, Linus Torvalds, Greg Kroah-Hartman, Mathias Nyman

This patch uses the simpler dma_set_mask_and_coherent() instead of
doing these as separate steps

Signed-off-by: Chunfeng Yun <chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
 drivers/usb/host/xhci-mtk.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 8fb6065..c197a6d 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -606,15 +606,10 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 	}
 
 	/* Initialize dma_mask and coherent_dma_mask to 32-bits */
-	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
+	ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
 	if (ret)
 		goto disable_clk;
 
-	if (!dev->dma_mask)
-		dev->dma_mask = &dev->coherent_dma_mask;
-	else
-		dma_set_mask(dev, DMA_BIT_MASK(32));
-
 	hcd = usb_create_hcd(driver, dev, dev_name(dev));
 	if (!hcd) {
 		ret = -ENOMEM;
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help