Skip to content

Commit

Permalink
DMA-API: usb: use new dma_coerce_mask_and_coherent()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King committed Oct 31, 2013
1 parent 22d9d8e commit e1fd734
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 49 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/chipidea/ci_hdrc_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)

pdata.phy = data->phy;

if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
goto err_clk;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/dwc3/dwc3-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we move to full device tree support this will vanish off.
*/
if (!dev->dma_mask)
dev->dma_mask = &dev->coherent_dma_mask;
ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (ret)
goto err1;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ehci-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (retval)
goto fail_create_hcd;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ehci-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!dev->dma_mask)
dev->dma_mask = &dev->coherent_dma_mask;
ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (ret)
return ret;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ehci-orion.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
* set. Since shared usb code relies on it, set it here for
* now. Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err)
goto err1;

Expand Down
5 changes: 2 additions & 3 deletions drivers/usb/host/ehci-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ static int ehci_platform_probe(struct platform_device *dev)
*/
if (!dev_get_platdata(&dev->dev))
dev->dev.platform_data = &ehci_platform_defaults;
if (!dev->dev.dma_mask)
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
err = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));

err = dma_coerce_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
if (err)
return err;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ehci-s5p.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ static int s5p_ehci_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we move to full device tree support this will vanish off.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err)
return err;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ehci-spear.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (retval)
goto fail;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ehci-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err)
return err;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ohci-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,7 @@ static int ohci_at91_of_init(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
return ret;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ohci-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we move to full device tree support this will vanish off.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err)
return err;

Expand Down
3 changes: 1 addition & 2 deletions drivers/usb/host/ohci-nxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev)
return -EPROBE_DEFER;
}

pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
goto fail_disable;

Expand Down
3 changes: 1 addition & 2 deletions drivers/usb/host/ohci-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev)
}

/* Ohci is a 32-bit device. */
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
return ret;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ohci-omap3.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!dev->dma_mask)
dev->dma_mask = &dev->coherent_dma_mask;
ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (ret)
goto err_io;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ohci-pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,7 @@ static int ohci_pxa_of_init(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
return ret;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/ohci-spear.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (retval)
goto fail;

Expand Down
4 changes: 1 addition & 3 deletions drivers/usb/host/uhci-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
* Since shared usb code relies on it, set it here for now.
* Once we have dma capability bindings this can go away.
*/
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (ret)
return ret;

Expand Down

0 comments on commit e1fd734

Please sign in to comment.