mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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>
This commit is contained in:
parent
85eebbc5e4
commit
94441c3bd9
@ -25,16 +25,6 @@
|
|||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/iommu.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)
|
static void iommu_bus_init(struct bus_type *bus, struct iommu_ops *ops)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -68,34 +58,25 @@ EXPORT_SYMBOL_GPL(bus_set_iommu);
|
|||||||
|
|
||||||
bool iommu_present(struct bus_type *bus)
|
bool iommu_present(struct bus_type *bus)
|
||||||
{
|
{
|
||||||
if (bus->iommu_ops != NULL)
|
return bus->iommu_ops != NULL;
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return iommu_ops != NULL;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iommu_present);
|
EXPORT_SYMBOL_GPL(iommu_present);
|
||||||
|
|
||||||
struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
|
struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
|
||||||
{
|
{
|
||||||
struct iommu_domain *domain;
|
struct iommu_domain *domain;
|
||||||
struct iommu_ops *ops;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (bus->iommu_ops)
|
if (bus == NULL || bus->iommu_ops == NULL)
|
||||||
ops = bus->iommu_ops;
|
|
||||||
else
|
|
||||||
ops = iommu_ops;
|
|
||||||
|
|
||||||
if (ops == NULL)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
domain = kmalloc(sizeof(*domain), GFP_KERNEL);
|
domain = kmalloc(sizeof(*domain), GFP_KERNEL);
|
||||||
if (!domain)
|
if (!domain)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
domain->ops = ops;
|
domain->ops = bus->iommu_ops;
|
||||||
|
|
||||||
ret = iommu_ops->domain_init(domain);
|
ret = domain->ops->domain_init(domain);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
|
||||||
|
@ -54,7 +54,6 @@ struct iommu_ops {
|
|||||||
unsigned long cap);
|
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 int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops);
|
||||||
extern bool iommu_present(struct bus_type *bus);
|
extern bool iommu_present(struct bus_type *bus);
|
||||||
extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
|
extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user