]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
DMA-API: usb: use new dma_coerce_mask_and_coherent()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 27 Jun 2013 11:36:37 +0000 (12:36 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 3 Oct 2013 09:24:56 +0000 (10:24 +0100)
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>
17 files changed:
drivers/usb/chipidea/ci_hdrc_imx.c
drivers/usb/dwc3/dwc3-exynos.c
drivers/usb/host/ehci-atmel.c
drivers/usb/host/ehci-omap.c
drivers/usb/host/ehci-orion.c
drivers/usb/host/ehci-platform.c
drivers/usb/host/ehci-s5p.c
drivers/usb/host/ehci-spear.c
drivers/usb/host/ehci-tegra.c
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-exynos.c
drivers/usb/host/ohci-nxp.c
drivers/usb/host/ohci-octeon.c
drivers/usb/host/ohci-omap3.c
drivers/usb/host/ohci-pxa27x.c
drivers/usb/host/ohci-spear.c
drivers/usb/host/uhci-platform.c

index bf33bd3e27b166095ad2ee4ccdae6769a7f2bd0e..af731dbda1e6594976d918f4b6c74c07c11c72ce 100644 (file)
@@ -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;
 
index c10b3248e047f6c65ad1c65fd95462f2b213a597..8b20c70d91e788c8e27791b98e454c4a5ba87ae7 100644 (file)
@@ -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;
 
index 5831a88623e4afc42a2facf30add792879394ed8..8e7323e07f794435d001ee2df81135fa5bc2325e 100644 (file)
@@ -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;
 
index d0759c5c03ab41e5b73d33526226e2f125752da0..6fa82d6b7661bea07d38dd249d76a80843ff4d01 100644 (file)
@@ -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;
 
index 58702066a8b7c1beefcaa1ee7da223d14ec60f87..2ba76730e6509ea8f9372234be96f9ea81796cd1 100644 (file)
@@ -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;
 
index 5b0cd2d5f9a67b3dfda42a22ec99b780a957fb5f..7f30b7168d5a53542cdbea786d9cba849a932579 100644 (file)
@@ -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;
 
index 10d6a2e307e17002ab6174aef014ba5b2c024787..d919ed47bd47fdc8f631b1804e74bd54e134cf17 100644 (file)
@@ -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;
 
index 6839e1504db5cb386f9e3112ac30093593c0fbfd..ee6f9ffaa0e73ef9a6ca237d4e28960162e01d51 100644 (file)
@@ -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;
 
index 3d9ee43ef2d77743c6d54481414234be25e9f20f..e74aaf3f016450a84ee42600ce584bebab41d9b0 100644 (file)
@@ -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;
 
index eb7a2cb264197fdb91ea26796d4c534615b39129..36423db63073bc9bce3d6fa28dbf624006f9b6e9 100644 (file)
@@ -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;
 
index ed685cbd58925037f173761ee6d2f7ad902f9de4..866f2464f9de64c84ac96114c96dccb52a472d32 100644 (file)
@@ -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;
 
index 5f82db409d654282ce961fe1c32726da99dd0fef..df3eb3e0324ea9ffde44836ed1788cd509d30d19 100644 (file)
@@ -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;
 
index ac1dea12a1a7b5ee50f6dfa829779260d3bec3c9..6c16dcef15c6fe0ee47d063a931cd7330c81da29 100644 (file)
@@ -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;
 
index 664f5dc409392bb79fbe759e27661bdc39dcad1e..db9bd6bc97b99106a80093d97262401c6862e167 100644 (file)
@@ -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;
 
index 74696ae29aa6981d26aaa79020765471b6bf8ee4..b64949bc43e2ebacc1620a76faf6d9db2935b16e 100644 (file)
@@ -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;
 
index 195a0a121107e9ea54c2b8f7b3470d395b4eddd9..075bb5e9b43fd0c4df8ddf63cfceffcc5ba1c81f 100644 (file)
@@ -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;
 
index 048912d4819cd04189532211bb6ec4015e9ce4ac..f8548b72f7089c1d3e10bebf1f8c070759798b7e 100644 (file)
@@ -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;