diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-06-27 07:36:37 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-31 10:49:04 -0400 |
commit | e1fd7341837238c6c5380c5073887d238f706cf0 (patch) | |
tree | 16828e0c17a48b42cf0cf2bd219cdf068601f7bd /drivers/usb | |
parent | 22d9d8e8316d7f69046c8805ce9aa8d9c43d4e5b (diff) |
DMA-API: usb: use new dma_coerce_mask_and_coherent()
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/ci_hdrc_imx.c | 4 | ||||
-rw-r--r-- | drivers/usb/dwc3/dwc3-exynos.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-atmel.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-omap.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-orion.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-platform.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/ehci-s5p.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-spear.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-exynos.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-nxp.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/ohci-octeon.c | 3 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap3.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ohci-spear.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/uhci-platform.c | 4 |
17 files changed, 18 insertions, 49 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index bf33bd3e27b1..af731dbda1e6 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c | |||
@@ -121,9 +121,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) | |||
121 | 121 | ||
122 | pdata.phy = data->phy; | 122 | pdata.phy = data->phy; |
123 | 123 | ||
124 | if (!pdev->dev.dma_mask) | 124 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
125 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
126 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
127 | if (ret) | 125 | if (ret) |
128 | goto err_clk; | 126 | goto err_clk; |
129 | 127 | ||
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index c10b3248e047..8b20c70d91e7 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c | |||
@@ -119,9 +119,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev) | |||
119 | * Since shared usb code relies on it, set it here for now. | 119 | * Since shared usb code relies on it, set it here for now. |
120 | * Once we move to full device tree support this will vanish off. | 120 | * Once we move to full device tree support this will vanish off. |
121 | */ | 121 | */ |
122 | if (!dev->dma_mask) | 122 | ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); |
123 | dev->dma_mask = &dev->coherent_dma_mask; | ||
124 | ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); | ||
125 | if (ret) | 123 | if (ret) |
126 | goto err1; | 124 | goto err1; |
127 | 125 | ||
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 5831a88623e4..8e7323e07f79 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c | |||
@@ -90,9 +90,7 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) | |||
90 | * Since shared usb code relies on it, set it here for now. | 90 | * Since shared usb code relies on it, set it here for now. |
91 | * Once we have dma capability bindings this can go away. | 91 | * Once we have dma capability bindings this can go away. |
92 | */ | 92 | */ |
93 | if (!pdev->dev.dma_mask) | 93 | retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
94 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
95 | retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
96 | if (retval) | 94 | if (retval) |
97 | goto fail_create_hcd; | 95 | goto fail_create_hcd; |
98 | 96 | ||
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index d0759c5c03ab..6fa82d6b7661 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c | |||
@@ -144,9 +144,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) | |||
144 | * Since shared usb code relies on it, set it here for now. | 144 | * Since shared usb code relies on it, set it here for now. |
145 | * Once we have dma capability bindings this can go away. | 145 | * Once we have dma capability bindings this can go away. |
146 | */ | 146 | */ |
147 | if (!dev->dma_mask) | 147 | ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); |
148 | dev->dma_mask = &dev->coherent_dma_mask; | ||
149 | ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); | ||
150 | if (ret) | 148 | if (ret) |
151 | return ret; | 149 | return ret; |
152 | 150 | ||
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 58702066a8b7..2ba76730e650 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c | |||
@@ -180,9 +180,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) | |||
180 | * set. Since shared usb code relies on it, set it here for | 180 | * set. Since shared usb code relies on it, set it here for |
181 | * now. Once we have dma capability bindings this can go away. | 181 | * now. Once we have dma capability bindings this can go away. |
182 | */ | 182 | */ |
183 | if (!pdev->dev.dma_mask) | 183 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
184 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
185 | err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
186 | if (err) | 184 | if (err) |
187 | goto err1; | 185 | goto err1; |
188 | 186 | ||
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 5b0cd2d5f9a6..7f30b7168d5a 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c | |||
@@ -89,9 +89,8 @@ static int ehci_platform_probe(struct platform_device *dev) | |||
89 | */ | 89 | */ |
90 | if (!dev_get_platdata(&dev->dev)) | 90 | if (!dev_get_platdata(&dev->dev)) |
91 | dev->dev.platform_data = &ehci_platform_defaults; | 91 | dev->dev.platform_data = &ehci_platform_defaults; |
92 | if (!dev->dev.dma_mask) | 92 | |
93 | dev->dev.dma_mask = &dev->dev.coherent_dma_mask; | 93 | err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); |
94 | err = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32)); | ||
95 | if (err) | 94 | if (err) |
96 | return err; | 95 | return err; |
97 | 96 | ||
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 10d6a2e307e1..d919ed47bd47 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c | |||
@@ -89,9 +89,7 @@ static int s5p_ehci_probe(struct platform_device *pdev) | |||
89 | * Since shared usb code relies on it, set it here for now. | 89 | * Since shared usb code relies on it, set it here for now. |
90 | * Once we move to full device tree support this will vanish off. | 90 | * Once we move to full device tree support this will vanish off. |
91 | */ | 91 | */ |
92 | if (!pdev->dev.dma_mask) | 92 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
93 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
94 | err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
95 | if (err) | 93 | if (err) |
96 | return err; | 94 | return err; |
97 | 95 | ||
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 6839e1504db5..ee6f9ffaa0e7 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c | |||
@@ -81,9 +81,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) | |||
81 | * Since shared usb code relies on it, set it here for now. | 81 | * Since shared usb code relies on it, set it here for now. |
82 | * Once we have dma capability bindings this can go away. | 82 | * Once we have dma capability bindings this can go away. |
83 | */ | 83 | */ |
84 | if (!pdev->dev.dma_mask) | 84 | retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
85 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
86 | retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
87 | if (retval) | 85 | if (retval) |
88 | goto fail; | 86 | goto fail; |
89 | 87 | ||
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 3d9ee43ef2d7..e74aaf3f0164 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -362,9 +362,7 @@ static int tegra_ehci_probe(struct platform_device *pdev) | |||
362 | * Since shared usb code relies on it, set it here for now. | 362 | * Since shared usb code relies on it, set it here for now. |
363 | * Once we have dma capability bindings this can go away. | 363 | * Once we have dma capability bindings this can go away. |
364 | */ | 364 | */ |
365 | if (!pdev->dev.dma_mask) | 365 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
366 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
367 | err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
368 | if (err) | 366 | if (err) |
369 | return err; | 367 | return err; |
370 | 368 | ||
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index eb7a2cb26419..36423db63073 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -536,9 +536,7 @@ static int ohci_at91_of_init(struct platform_device *pdev) | |||
536 | * Since shared usb code relies on it, set it here for now. | 536 | * Since shared usb code relies on it, set it here for now. |
537 | * Once we have dma capability bindings this can go away. | 537 | * Once we have dma capability bindings this can go away. |
538 | */ | 538 | */ |
539 | if (!pdev->dev.dma_mask) | 539 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
540 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
541 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
542 | if (ret) | 540 | if (ret) |
543 | return ret; | 541 | return ret; |
544 | 542 | ||
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index ed685cbd5892..866f2464f9de 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c | |||
@@ -114,9 +114,7 @@ static int exynos_ohci_probe(struct platform_device *pdev) | |||
114 | * Since shared usb code relies on it, set it here for now. | 114 | * Since shared usb code relies on it, set it here for now. |
115 | * Once we move to full device tree support this will vanish off. | 115 | * Once we move to full device tree support this will vanish off. |
116 | */ | 116 | */ |
117 | if (!pdev->dev.dma_mask) | 117 | err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
118 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
119 | err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
120 | if (err) | 118 | if (err) |
121 | return err; | 119 | return err; |
122 | 120 | ||
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c index 5f82db409d65..df3eb3e0324e 100644 --- a/drivers/usb/host/ohci-nxp.c +++ b/drivers/usb/host/ohci-nxp.c | |||
@@ -226,8 +226,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
226 | return -EPROBE_DEFER; | 226 | return -EPROBE_DEFER; |
227 | } | 227 | } |
228 | 228 | ||
229 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 229 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
230 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
231 | if (ret) | 230 | if (ret) |
232 | goto fail_disable; | 231 | goto fail_disable; |
233 | 232 | ||
diff --git a/drivers/usb/host/ohci-octeon.c b/drivers/usb/host/ohci-octeon.c index ac1dea12a1a7..6c16dcef15c6 100644 --- a/drivers/usb/host/ohci-octeon.c +++ b/drivers/usb/host/ohci-octeon.c | |||
@@ -127,8 +127,7 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev) | |||
127 | } | 127 | } |
128 | 128 | ||
129 | /* Ohci is a 32-bit device. */ | 129 | /* Ohci is a 32-bit device. */ |
130 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | 130 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
131 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
132 | if (ret) | 131 | if (ret) |
133 | return ret; | 132 | return ret; |
134 | 133 | ||
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c index 664f5dc40939..db9bd6bc97b9 100644 --- a/drivers/usb/host/ohci-omap3.c +++ b/drivers/usb/host/ohci-omap3.c | |||
@@ -166,9 +166,7 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev) | |||
166 | * Since shared usb code relies on it, set it here for now. | 166 | * Since shared usb code relies on it, set it here for now. |
167 | * Once we have dma capability bindings this can go away. | 167 | * Once we have dma capability bindings this can go away. |
168 | */ | 168 | */ |
169 | if (!dev->dma_mask) | 169 | ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); |
170 | dev->dma_mask = &dev->coherent_dma_mask; | ||
171 | ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); | ||
172 | if (ret) | 170 | if (ret) |
173 | goto err_io; | 171 | goto err_io; |
174 | 172 | ||
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 74696ae29aa6..b64949bc43e2 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -296,9 +296,7 @@ static int ohci_pxa_of_init(struct platform_device *pdev) | |||
296 | * Since shared usb code relies on it, set it here for now. | 296 | * Since shared usb code relies on it, set it here for now. |
297 | * Once we have dma capability bindings this can go away. | 297 | * Once we have dma capability bindings this can go away. |
298 | */ | 298 | */ |
299 | if (!pdev->dev.dma_mask) | 299 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
300 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
301 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
302 | if (ret) | 300 | if (ret) |
303 | return ret; | 301 | return ret; |
304 | 302 | ||
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 195a0a121107..075bb5e9b43f 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c | |||
@@ -111,9 +111,7 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) | |||
111 | * Since shared usb code relies on it, set it here for now. | 111 | * Since shared usb code relies on it, set it here for now. |
112 | * Once we have dma capability bindings this can go away. | 112 | * Once we have dma capability bindings this can go away. |
113 | */ | 113 | */ |
114 | if (!pdev->dev.dma_mask) | 114 | retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
115 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
116 | retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
117 | if (retval) | 115 | if (retval) |
118 | goto fail; | 116 | goto fail; |
119 | 117 | ||
diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c index 048912d4819c..f8548b72f708 100644 --- a/drivers/usb/host/uhci-platform.c +++ b/drivers/usb/host/uhci-platform.c | |||
@@ -75,9 +75,7 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev) | |||
75 | * Since shared usb code relies on it, set it here for now. | 75 | * Since shared usb code relies on it, set it here for now. |
76 | * Once we have dma capability bindings this can go away. | 76 | * Once we have dma capability bindings this can go away. |
77 | */ | 77 | */ |
78 | if (!pdev->dev.dma_mask) | 78 | ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
79 | pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; | ||
80 | ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); | ||
81 | if (ret) | 79 | if (ret) |
82 | return ret; | 80 | return ret; |
83 | 81 | ||