Commit a7ba5c3d authored by Will Deacon's avatar Will Deacon Committed by Joerg Roedel

drivers/iommu: Export core IOMMU API symbols to permit modular drivers

Building IOMMU drivers as modules requires that the core IOMMU API
symbols are exported as GPL symbols.
Signed-off-by: default avatarWill Deacon <will@kernel.org>
Tested-by: John Garry <john.garry@huawei.com> # smmu v3
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 46cf053e
...@@ -87,6 +87,7 @@ int iommu_device_sysfs_add(struct iommu_device *iommu, ...@@ -87,6 +87,7 @@ int iommu_device_sysfs_add(struct iommu_device *iommu,
put_device(iommu->dev); put_device(iommu->dev);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(iommu_device_sysfs_add);
void iommu_device_sysfs_remove(struct iommu_device *iommu) void iommu_device_sysfs_remove(struct iommu_device *iommu)
{ {
...@@ -94,6 +95,8 @@ void iommu_device_sysfs_remove(struct iommu_device *iommu) ...@@ -94,6 +95,8 @@ void iommu_device_sysfs_remove(struct iommu_device *iommu)
device_unregister(iommu->dev); device_unregister(iommu->dev);
iommu->dev = NULL; iommu->dev = NULL;
} }
EXPORT_SYMBOL_GPL(iommu_device_sysfs_remove);
/* /*
* IOMMU drivers can indicate a device is managed by a given IOMMU using * IOMMU drivers can indicate a device is managed by a given IOMMU using
* this interface. A link to the device will be created in the "devices" * this interface. A link to the device will be created in the "devices"
...@@ -119,6 +122,7 @@ int iommu_device_link(struct iommu_device *iommu, struct device *link) ...@@ -119,6 +122,7 @@ int iommu_device_link(struct iommu_device *iommu, struct device *link)
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(iommu_device_link);
void iommu_device_unlink(struct iommu_device *iommu, struct device *link) void iommu_device_unlink(struct iommu_device *iommu, struct device *link)
{ {
...@@ -128,3 +132,4 @@ void iommu_device_unlink(struct iommu_device *iommu, struct device *link) ...@@ -128,3 +132,4 @@ void iommu_device_unlink(struct iommu_device *iommu, struct device *link)
sysfs_remove_link(&link->kobj, "iommu"); sysfs_remove_link(&link->kobj, "iommu");
sysfs_remove_link_from_group(&iommu->dev->kobj, "devices", dev_name(link)); sysfs_remove_link_from_group(&iommu->dev->kobj, "devices", dev_name(link));
} }
EXPORT_SYMBOL_GPL(iommu_device_unlink);
...@@ -141,6 +141,7 @@ int iommu_device_register(struct iommu_device *iommu) ...@@ -141,6 +141,7 @@ int iommu_device_register(struct iommu_device *iommu)
spin_unlock(&iommu_device_lock); spin_unlock(&iommu_device_lock);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(iommu_device_register);
void iommu_device_unregister(struct iommu_device *iommu) void iommu_device_unregister(struct iommu_device *iommu)
{ {
...@@ -148,6 +149,7 @@ void iommu_device_unregister(struct iommu_device *iommu) ...@@ -148,6 +149,7 @@ void iommu_device_unregister(struct iommu_device *iommu)
list_del(&iommu->list); list_del(&iommu->list);
spin_unlock(&iommu_device_lock); spin_unlock(&iommu_device_lock);
} }
EXPORT_SYMBOL_GPL(iommu_device_unregister);
static struct iommu_param *iommu_get_dev_param(struct device *dev) static struct iommu_param *iommu_get_dev_param(struct device *dev)
{ {
...@@ -886,6 +888,7 @@ struct iommu_group *iommu_group_ref_get(struct iommu_group *group) ...@@ -886,6 +888,7 @@ struct iommu_group *iommu_group_ref_get(struct iommu_group *group)
kobject_get(group->devices_kobj); kobject_get(group->devices_kobj);
return group; return group;
} }
EXPORT_SYMBOL_GPL(iommu_group_ref_get);
/** /**
* iommu_group_put - Decrement group reference * iommu_group_put - Decrement group reference
...@@ -1259,6 +1262,7 @@ struct iommu_group *generic_device_group(struct device *dev) ...@@ -1259,6 +1262,7 @@ struct iommu_group *generic_device_group(struct device *dev)
{ {
return iommu_group_alloc(); return iommu_group_alloc();
} }
EXPORT_SYMBOL_GPL(generic_device_group);
/* /*
* Use standard PCI bus topology, isolation features, and DMA alias quirks * Use standard PCI bus topology, isolation features, and DMA alias quirks
...@@ -1326,6 +1330,7 @@ struct iommu_group *pci_device_group(struct device *dev) ...@@ -1326,6 +1330,7 @@ struct iommu_group *pci_device_group(struct device *dev)
/* No shared group found, allocate new */ /* No shared group found, allocate new */
return iommu_group_alloc(); return iommu_group_alloc();
} }
EXPORT_SYMBOL_GPL(pci_device_group);
/* Get the IOMMU group for device on fsl-mc bus */ /* Get the IOMMU group for device on fsl-mc bus */
struct iommu_group *fsl_mc_device_group(struct device *dev) struct iommu_group *fsl_mc_device_group(struct device *dev)
...@@ -1338,6 +1343,7 @@ struct iommu_group *fsl_mc_device_group(struct device *dev) ...@@ -1338,6 +1343,7 @@ struct iommu_group *fsl_mc_device_group(struct device *dev)
group = iommu_group_alloc(); group = iommu_group_alloc();
return group; return group;
} }
EXPORT_SYMBOL_GPL(fsl_mc_device_group);
/** /**
* iommu_group_get_for_dev - Find or create the IOMMU group for a device * iommu_group_get_for_dev - Find or create the IOMMU group for a device
...@@ -1406,6 +1412,7 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) ...@@ -1406,6 +1412,7 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev)
return group; return group;
} }
EXPORT_SYMBOL(iommu_group_get_for_dev);
struct iommu_domain *iommu_group_default_domain(struct iommu_group *group) struct iommu_domain *iommu_group_default_domain(struct iommu_group *group)
{ {
...@@ -2246,6 +2253,7 @@ struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start, ...@@ -2246,6 +2253,7 @@ struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start,
region->type = type; region->type = type;
return region; return region;
} }
EXPORT_SYMBOL_GPL(iommu_alloc_resv_region);
static int static int
request_default_domain_for_dev(struct device *dev, unsigned long type) request_default_domain_for_dev(struct device *dev, unsigned long type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment