--- initial
+++ final
@@ -1,100 +1,99 @@
 static int ehci_orion_drv_probe(struct platform_device *pdev) {
   struct orion_ehci_data *pd = dev_get_platdata(&pdev->dev);
   const struct mbus_dram_target_info *dram;
   struct resource *res;
   struct usb_hcd *hcd;
   struct ehci_hcd *ehci;
   struct clk *clk;
   void __iomem *regs;
   int irq, err;
   enum orion_ehci_phy_ver phy_version;
   if (usb_disabled()) return -ENODEV;
   pr_debug("Initializing Orion-SoC USB Host Controller\n");
   if (pdev->dev.of_node)
     irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
   else
     irq = platform_get_irq(pdev, 0);
   if (irq <= 0) {
     dev_err(&pdev->dev, "Found HC with no IRQ. Check %s setup!\n", dev_name(&pdev->dev));
     err = -ENODEV;
     goto err1;
   }
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   if (!res) {
     dev_err(&pdev->dev, "Found HC with no register addr. Check %s setup!\n", dev_name(&pdev->dev));
     err = -ENODEV;
     goto err1;
   }
   /*
    * 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 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;
   if (!request_mem_region(res->start, resource_size(res), ehci_orion_hc_driver.description)) {
     dev_dbg(&pdev->dev, "controller already in use\n");
     err = -EBUSY;
     goto err1;
   }
   regs = ioremap(res->start, resource_size(res));
   if (regs == NULL) {
     dev_dbg(&pdev->dev, "error mapping memory\n");
     err = -EFAULT;
     goto err2;
   }
   /* Not all platforms can gate the clock, so it is not
      an error if the clock does not exists. */
   clk = clk_get(&pdev->dev, NULL);
   if (!IS_ERR(clk)) {
     clk_prepare_enable(clk);
     clk_put(clk);
   }
   hcd = usb_create_hcd(&ehci_orion_hc_driver, &pdev->dev, dev_name(&pdev->dev));
   if (!hcd) {
     err = -ENOMEM;
     goto err3;
   }
   hcd->rsrc_start = res->start;
   hcd->rsrc_len = resource_size(res);
   hcd->regs = regs;
   ehci = hcd_to_ehci(hcd);
   ehci->caps = hcd->regs + 0x100;
   hcd->has_tt = 1;
   /*
    * (Re-)program MBUS remapping windows if we are asked to.
    */
   dram = mv_mbus_dram_info();
   if (dram) ehci_orion_conf_mbus_windows(hcd, dram);
   /*
    * setup Orion USB controller.
    */
   if (pdev->dev.of_node)
     phy_version = EHCI_PHY_NA;
   else
     phy_version = pd->phy_version;
   switch (phy_version) {
   case EHCI_PHY_NA: /* dont change USB phy settings */ break;
   case EHCI_PHY_ORION: orion_usb_phy_v1_setup(hcd); break;
   case EHCI_PHY_DD:
   case EHCI_PHY_KW:
   default: printk(KERN_WARNING "Orion ehci -USB phy version isn't supported.\n");
   }
   err = usb_add_hcd(hcd, irq, IRQF_SHARED);
   if (err) goto err4;
   return 0;
 err4:
   usb_put_hcd(hcd);
 err3:
   if (!IS_ERR(clk)) {
     clk_disable_unprepare(clk);
     clk_put(clk);
   }
   iounmap(regs);
 err2:
   release_mem_region(res->start, resource_size(res));
 err1:
   dev_err(&pdev->dev, "init %s fail, %d\n", dev_name(&pdev->dev), err);
   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);