Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271587
b: refs/heads/master
c: 94441c3
h: refs/heads/master
i:
  271585: ff9e204
  271583: 30817fd
v: v3
  • Loading branch information
Joerg Roedel committed Oct 21, 2011
1 parent 9108795 commit 89a4692
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85eebbc5e4633e6eee10bdddd00d175daadd5841
refs/heads/master: 94441c3bd99287b9d84f148a08cc9a44675ec749
27 changes: 4 additions & 23 deletions trunk/drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down Expand Up @@ -68,34 +58,25 @@ 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);

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;

Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ struct iommu_ops {
unsigned long cap);
};

extern void register_iommu(struct iommu_ops *ops);
extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops);
extern bool iommu_present(struct bus_type *bus);
extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
Expand Down

0 comments on commit 89a4692

Please sign in to comment.