--- initial
+++ final
@@ -1,98 +1,97 @@
 static int s5p_ehci_probe(struct platform_device *pdev) {
   struct s5p_ehci_platdata *pdata = dev_get_platdata(&pdev->dev);
   struct s5p_ehci_hcd *s5p_ehci;
   struct usb_hcd *hcd;
   struct ehci_hcd *ehci;
   struct resource *res;
   struct usb_phy *phy;
   int irq;
   int err;
   /*
    * Right now device-tree probed devices don't get dma_mask set.
    * 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;
   s5p_setup_vbus_gpio(pdev);
   hcd = usb_create_hcd(&s5p_ehci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
   if (!hcd) {
     dev_err(&pdev->dev, "Unable to create HCD\n");
     return -ENOMEM;
   }
   s5p_ehci = to_s5p_ehci(hcd);
   if (of_device_is_compatible(pdev->dev.of_node, "samsung,exynos5440-ehci")) {
     s5p_ehci->pdata = &empty_platdata;
     goto skip_phy;
   }
   phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
   if (IS_ERR(phy)) {
     /* Fallback to pdata */
     if (!pdata) {
       usb_put_hcd(hcd);
       dev_warn(&pdev->dev, "no platform data or transceiver defined\n");
       return -EPROBE_DEFER;
     } else {
       s5p_ehci->pdata = pdata;
     }
   } else {
     s5p_ehci->phy = phy;
     s5p_ehci->otg = phy->otg;
   }
 skip_phy:
   s5p_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");
   if (IS_ERR(s5p_ehci->clk)) {
     dev_err(&pdev->dev, "Failed to get usbhost clock\n");
     err = PTR_ERR(s5p_ehci->clk);
     goto fail_clk;
   }
   err = clk_prepare_enable(s5p_ehci->clk);
   if (err) goto fail_clk;
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   if (!res) {
     dev_err(&pdev->dev, "Failed to get I/O memory\n");
     err = -ENXIO;
     goto fail_io;
   }
   hcd->rsrc_start = res->start;
   hcd->rsrc_len = resource_size(res);
   hcd->regs = devm_ioremap(&pdev->dev, res->start, hcd->rsrc_len);
   if (!hcd->regs) {
     dev_err(&pdev->dev, "Failed to remap I/O memory\n");
     err = -ENOMEM;
     goto fail_io;
   }
   irq = platform_get_irq(pdev, 0);
   if (!irq) {
     dev_err(&pdev->dev, "Failed to get IRQ\n");
     err = -ENODEV;
     goto fail_io;
   }
   if (s5p_ehci->otg) s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
   if (s5p_ehci->phy)
     usb_phy_init(s5p_ehci->phy);
   else if (s5p_ehci->pdata->phy_init)
     s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
   ehci = hcd_to_ehci(hcd);
   ehci->caps = hcd->regs;
   /* DMA burst Enable */
   writel(EHCI_INSNREG00_ENABLE_DMA_BURST, EHCI_INSNREG00(hcd->regs));
   err = usb_add_hcd(hcd, irq, IRQF_SHARED);
   if (err) {
     dev_err(&pdev->dev, "Failed to add USB HCD\n");
     goto fail_add_hcd;
   }
   platform_set_drvdata(pdev, hcd);
   return 0;
 fail_add_hcd:
   if (s5p_ehci->phy)
     usb_phy_shutdown(s5p_ehci->phy);
   else if (s5p_ehci->pdata->phy_exit)
     s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
 fail_io:
   clk_disable_unprepare(s5p_ehci->clk);
 fail_clk:
   usb_put_hcd(hcd);
   return err;
 }<sep>@@
expression ret,dev,v;
@@

-       if (!dev.dma_mask)
-               dev.dma_mask = &dev.coherent_dma_mask;
-       ret = dma_set_coherent_mask(&dev, v);
+       ret = dma_coerce_mask_and_coherent(&dev, v);