summaryrefslogtreecommitdiff
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2011-09-06 18:58:54 +0200
committerHiroshi DOYU <hdoyu@nvidia.com>2012-01-23 11:11:36 +0200
commit1bf55a7a38cb1e71e41a47f56f1b340fcd3ac672 (patch)
tree50bdf8f59460e43bf7f0a401b4490740fbbcff33 /drivers/iommu/iommu.c
parent1c177619f41e3ff945c7d4fe988976c65d3a44b5 (diff)
iommu/core: Remove global iommu_ops and register_iommu
With all IOMMU drivers being converted to bus_set_iommu the global iommu_ops are no longer required. The same is true for the deprecated register_iommu function. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 90f8e340b576..2fb2963df553 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -25,16 +25,6 @@
#include <linux/errno.h>
#include <linux/iommu.h>
-static struct iommu_ops *iommu_ops;
-
-void register_iommu(struct iommu_ops *ops)
-{
- if (iommu_ops)
- BUG();
-
- iommu_ops = ops;
-}
-
static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops)
{
}
@@ -68,10 +58,7 @@ EXPORT_SYMBOL_GPL(bus_set_iommu);
bool iommu_present(struct bus_type *bus)
{
- if (bus->iommu_ops != NULL)
- return true;
- else
- return iommu_ops != NULL;
+ return bus->iommu_ops != NULL;
}
EXPORT_SYMBOL_GPL(iommu_present);
@@ -98,24 +85,18 @@ EXPORT_SYMBOL_GPL(iommu_set_fault_handler);
struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
{
struct iommu_domain *domain;
- struct iommu_ops *ops;
int ret;
- if (bus->iommu_ops)
- ops = bus->iommu_ops;
- else
- ops = iommu_ops;
-
- if (ops == NULL)
+ if (bus == NULL || bus->iommu_ops == NULL)
return NULL;
domain = kmalloc(sizeof(*domain), GFP_KERNEL);
if (!domain)
return NULL;
- domain->ops = ops;
+ domain->ops = bus->iommu_ops;
- ret = iommu_ops->domain_init(domain);
+ ret = domain->ops->domain_init(domain);
if (ret)
goto out_free;