struct device_node *master_np)
 {
        const struct iommu_ops *ops = NULL;
-       struct iommu_fwspec *fwspec = dev->iommu_fwspec;
+       struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
        int err = NO_IOMMU;
 
        if (!master_np)
                }
        }
 
+
        /*
         * Two success conditions can be represented by non-negative err here:
         * >0 : there is no IOMMU, or one was unavailable for non-fatal reasons
         *  0 : we found an IOMMU, and dev->fwspec is initialised appropriately
         * <0 : any actual error
         */
-       if (!err)
-               ops = dev->iommu_fwspec->ops;
+       if (!err) {
+               /* The fwspec pointer changed, read it again */
+               fwspec = dev_iommu_fwspec_get(dev);
+               ops    = fwspec->ops;
+       }
        /*
         * If we have reason to believe the IOMMU driver missed the initial
         * add_device callback for dev, replay it to get things in order.