--- initial
+++ final
@@ -1,108 +1,107 @@
 static int tegra_ehci_probe(struct platform_device *pdev) {
   const struct of_device_id *match;
   const struct tegra_ehci_soc_config *soc_config;
   struct resource *res;
   struct usb_hcd *hcd;
   struct ehci_hcd *ehci;
   struct tegra_ehci_hcd *tegra;
   int err = 0;
   int irq;
   struct usb_phy *u_phy;
   match = of_match_device(tegra_ehci_of_match, &pdev->dev);
   if (!match) {
     dev_err(&pdev->dev, "Error: No device match found\n");
     return -ENODEV;
   }
   soc_config = match->data;
   /* 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) return err;
   hcd = usb_create_hcd(&tegra_ehci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
   if (!hcd) {
     dev_err(&pdev->dev, "Unable to create HCD\n");
     return -ENOMEM;
   }
   platform_set_drvdata(pdev, hcd);
   ehci = hcd_to_ehci(hcd);
   tegra = (struct tegra_ehci_hcd *)ehci->priv;
   hcd->has_tt = 1;
   tegra->clk = devm_clk_get(&pdev->dev, NULL);
   if (IS_ERR(tegra->clk)) {
     dev_err(&pdev->dev, "Can't get ehci clock\n");
     err = PTR_ERR(tegra->clk);
     goto cleanup_hcd_create;
   }
   err = clk_prepare_enable(tegra->clk);
   if (err) goto cleanup_clk_get;
   tegra_periph_reset_assert(tegra->clk);
   udelay(1);
   tegra_periph_reset_deassert(tegra->clk);
   u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0);
   if (IS_ERR(u_phy)) {
     err = PTR_ERR(u_phy);
     goto cleanup_clk_en;
   }
   hcd->phy = u_phy;
   tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node, "nvidia,needs-double-reset");
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   if (!res) {
     dev_err(&pdev->dev, "Failed to get I/O memory\n");
     err = -ENXIO;
     goto cleanup_clk_en;
   }
   hcd->rsrc_start = res->start;
   hcd->rsrc_len = resource_size(res);
   hcd->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
   if (!hcd->regs) {
     dev_err(&pdev->dev, "Failed to remap I/O memory\n");
     err = -ENOMEM;
     goto cleanup_clk_en;
   }
   ehci->caps = hcd->regs + 0x100;
   ehci->has_hostpc = soc_config->has_hostpc;
   err = usb_phy_init(hcd->phy);
   if (err) {
     dev_err(&pdev->dev, "Failed to initialize phy\n");
     goto cleanup_clk_en;
   }
   u_phy->otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), GFP_KERNEL);
   if (!u_phy->otg) {
     dev_err(&pdev->dev, "Failed to alloc memory for otg\n");
     err = -ENOMEM;
     goto cleanup_phy;
   }
   u_phy->otg->host = hcd_to_bus(hcd);
   err = usb_phy_set_suspend(hcd->phy, 0);
   if (err) {
     dev_err(&pdev->dev, "Failed to power on the phy\n");
     goto cleanup_phy;
   }
   irq = platform_get_irq(pdev, 0);
   if (!irq) {
     dev_err(&pdev->dev, "Failed to get IRQ\n");
     err = -ENODEV;
     goto cleanup_phy;
   }
   otg_set_host(u_phy->otg, &hcd->self);
   err = usb_add_hcd(hcd, irq, IRQF_SHARED);
   if (err) {
     dev_err(&pdev->dev, "Failed to add USB HCD\n");
     goto cleanup_otg_set_host;
   }
   return err;
 cleanup_otg_set_host:
   otg_set_host(u_phy->otg, NULL);
 cleanup_phy:
   usb_phy_shutdown(hcd->phy);
 cleanup_clk_en:
   clk_disable_unprepare(tegra->clk);
 cleanup_clk_get:
   clk_put(tegra->clk);
 cleanup_hcd_create:
   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);