--- initial
+++ final
@@ -1,114 +1,113 @@
 static int ehci_hcd_omap_probe(struct platform_device *pdev) {
   struct device *dev = &pdev->dev;
   struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev);
   struct resource *res;
   struct usb_hcd *hcd;
   void __iomem *regs;
   int ret;
   int irq;
   int i;
   struct omap_hcd *omap;
   if (usb_disabled()) return -ENODEV;
   if (!dev->parent) {
     dev_err(dev, "Missing parent device\n");
     return -ENODEV;
   }
   /* For DT boot, get platform data from parent. i.e. usbhshost */
   if (dev->of_node) {
     pdata = dev_get_platdata(dev->parent);
     dev->platform_data = pdata;
   }
   if (!pdata) {
     dev_err(dev, "Missing platform data\n");
     return -ENODEV;
   }
   irq = platform_get_irq(pdev, 0);
   if (irq < 0) {
     dev_err(dev, "EHCI irq failed\n");
     return -ENODEV;
   }
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   regs = devm_ioremap_resource(dev, res);
   if (IS_ERR(regs)) return PTR_ERR(regs);
   /*
    * 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 (!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;
   ret = -ENODEV;
   hcd = usb_create_hcd(&ehci_omap_hc_driver, dev, dev_name(dev));
   if (!hcd) {
     dev_err(dev, "Failed to create HCD\n");
     return -ENOMEM;
   }
   hcd->rsrc_start = res->start;
   hcd->rsrc_len = resource_size(res);
   hcd->regs = regs;
   hcd_to_ehci(hcd)->caps = regs;
   omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
   omap->nports = pdata->nports;
   platform_set_drvdata(pdev, hcd);
   /* get the PHY devices if needed */
   for (i = 0; i < omap->nports; i++) {
     struct usb_phy *phy;
     /* get the PHY device */
     if (dev->of_node)
       phy = devm_usb_get_phy_by_phandle(dev, "phys", i);
     else
       phy = devm_usb_get_phy_dev(dev, i);
     if (IS_ERR(phy)) {
       /* Don't bail out if PHY is not absolutely necessary */
       if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) continue;
       ret = PTR_ERR(phy);
       dev_err(dev, "Can't get PHY device for port %d: %d\n", i, ret);
       goto err_phy;
     }
     omap->phy[i] = phy;
     if (pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY) {
       usb_phy_init(omap->phy[i]);
       /* bring PHY out of suspend */
       usb_phy_set_suspend(omap->phy[i], 0);
     }
   }
   pm_runtime_enable(dev);
   pm_runtime_get_sync(dev);
   /*
    * An undocumented "feature" in the OMAP3 EHCI controller,
    * causes suspended ports to be taken out of suspend when
    * the USBCMD.Run/Stop bit is cleared (for example when
    * we do ehci_bus_suspend).
    * This breaks suspend-resume if the root-hub is allowed
    * to suspend. Writing 1 to this undocumented register bit
    * disables this feature and restores normal behavior.
    */
   ehci_write(regs, EHCI_INSNREG04, EHCI_INSNREG04_DISABLE_UNSUSPEND);
   ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
   if (ret) {
     dev_err(dev, "failed to add hcd with err %d\n", ret);
     goto err_pm_runtime;
   }
   /*
    * Bring PHYs out of reset for non PHY modes.
    * Even though HSIC mode is a PHY-less mode, the reset
    * line exists between the chips and can be modelled
    * as a PHY device for reset control.
    */
   for (i = 0; i < omap->nports; i++) {
     if (!omap->phy[i] || pdata->port_mode[i] == OMAP_EHCI_PORT_MODE_PHY) continue;
     usb_phy_init(omap->phy[i]);
     /* bring PHY out of suspend */
     usb_phy_set_suspend(omap->phy[i], 0);
   }
   return 0;
 err_pm_runtime:
   pm_runtime_put_sync(dev);
 err_phy:
   for (i = 0; i < omap->nports; i++) {
     if (omap->phy[i]) usb_phy_shutdown(omap->phy[i]);
   }
   usb_put_hcd(hcd);
   return ret;
 }<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);