mediatek: backport upstream mediatek patches
[oweals/openwrt.git] / target / linux / mediatek / patches-4.14 / 0126-usb-xhci-mtk-use-dma_set_mask_and_coherent-in-probe-.patch
1 From 9f617ce19c5dab429a539d411204ae220b5b8cd6 Mon Sep 17 00:00:00 2001
2 From: Chunfeng Yun <chunfeng.yun@mediatek.com>
3 Date: Fri, 13 Oct 2017 16:26:33 +0800
4 Subject: [PATCH 126/224] usb: xhci-mtk: use dma_set_mask_and_coherent() in
5  probe function
6
7 This patch uses the simpler dma_set_mask_and_coherent() instead of
8 doing these as separate steps
9
10 Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
11 Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
12 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13 ---
14  drivers/usb/host/xhci-mtk.c | 7 +------
15  1 file changed, 1 insertion(+), 6 deletions(-)
16
17 diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
18 index 8fb60657ed4f..c197a6d9e157 100644
19 --- a/drivers/usb/host/xhci-mtk.c
20 +++ b/drivers/usb/host/xhci-mtk.c
21 @@ -606,15 +606,10 @@ static int xhci_mtk_probe(struct platform_device *pdev)
22         }
23  
24         /* Initialize dma_mask and coherent_dma_mask to 32-bits */
25 -       ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
26 +       ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
27         if (ret)
28                 goto disable_clk;
29  
30 -       if (!dev->dma_mask)
31 -               dev->dma_mask = &dev->coherent_dma_mask;
32 -       else
33 -               dma_set_mask(dev, DMA_BIT_MASK(32));
34 -
35         hcd = usb_create_hcd(driver, dev, dev_name(dev));
36         if (!hcd) {
37                 ret = -ENOMEM;
38 -- 
39 2.11.0
40