Merge branches 'amd/fixes', 'debug/dma-api', 'arm/omap', 'arm/msm', 'core', 'iommu...
[linux-2.6.git] / drivers / iommu / omap-iommu.c
index 4d2ba0d..8f32b2b 100644 (file)
@@ -775,6 +775,7 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
        u32 da, errs;
        u32 *iopgd, *iopte;
        struct omap_iommu *obj = data;
+       struct iommu_domain *domain = obj->domain;
 
        if (!obj->refcount)
                return IRQ_NONE;
@@ -786,7 +787,7 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
                return IRQ_HANDLED;
 
        /* Fault callback or TLB/PTE Dynamic loading */
-       if (obj->isr && !obj->isr(obj, da, errs, obj->isr_priv))
+       if (!report_iommu_fault(domain, obj->dev, da, 0))
                return IRQ_HANDLED;
 
        iommu_disable(obj);
@@ -904,33 +905,6 @@ static void omap_iommu_detach(struct omap_iommu *obj)
        dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
 }
 
-int omap_iommu_set_isr(const char *name,
-                 int (*isr)(struct omap_iommu *obj, u32 da, u32 iommu_errs,
-                            void *priv),
-                 void *isr_priv)
-{
-       struct device *dev;
-       struct omap_iommu *obj;
-
-       dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name,
-                                device_match_by_alias);
-       if (!dev)
-               return -ENODEV;
-
-       obj = to_iommu(dev);
-       spin_lock(&obj->iommu_lock);
-       if (obj->refcount != 0) {
-               spin_unlock(&obj->iommu_lock);
-               return -EBUSY;
-       }
-       obj->isr = isr;
-       obj->isr_priv = isr_priv;
-       spin_unlock(&obj->iommu_lock);
-
-       return 0;
-}
-EXPORT_SYMBOL_GPL(omap_iommu_set_isr);
-
 /*
  *     OMAP Device MMU(IOMMU) detection
  */
@@ -1115,6 +1089,7 @@ omap_iommu_attach_dev(struct iommu_domain *domain, struct device *dev)
        }
 
        omap_domain->iommu_dev = oiommu;
+       oiommu->domain = domain;
 
 out:
        spin_unlock(&omap_domain->lock);
@@ -1250,7 +1225,7 @@ static int __init omap_iommu_init(void)
                return -ENOMEM;
        iopte_cachep = p;
 
-       register_iommu(&omap_iommu_ops);
+       bus_set_iommu(&platform_bus_type, &omap_iommu_ops);
 
        return platform_driver_register(&omap_iommu_driver);
 }