diff options
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/iommu.c | 43 | ||||
| -rw-r--r-- | drivers/base/platform.c | 4 |
2 files changed, 31 insertions, 16 deletions
diff --git a/drivers/base/iommu.c b/drivers/base/iommu.c index 8ad4ffea6920..6e6b6a11b3ce 100644 --- a/drivers/base/iommu.c +++ b/drivers/base/iommu.c | |||
| @@ -80,20 +80,6 @@ void iommu_detach_device(struct iommu_domain *domain, struct device *dev) | |||
| 80 | } | 80 | } |
| 81 | EXPORT_SYMBOL_GPL(iommu_detach_device); | 81 | EXPORT_SYMBOL_GPL(iommu_detach_device); |
| 82 | 82 | ||
| 83 | int iommu_map_range(struct iommu_domain *domain, unsigned long iova, | ||
| 84 | phys_addr_t paddr, size_t size, int prot) | ||
| 85 | { | ||
| 86 | return iommu_ops->map(domain, iova, paddr, size, prot); | ||
| 87 | } | ||
| 88 | EXPORT_SYMBOL_GPL(iommu_map_range); | ||
| 89 | |||
| 90 | void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova, | ||
| 91 | size_t size) | ||
| 92 | { | ||
| 93 | iommu_ops->unmap(domain, iova, size); | ||
| 94 | } | ||
| 95 | EXPORT_SYMBOL_GPL(iommu_unmap_range); | ||
| 96 | |||
| 97 | phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 83 | phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
| 98 | unsigned long iova) | 84 | unsigned long iova) |
| 99 | { | 85 | { |
| @@ -107,3 +93,32 @@ int iommu_domain_has_cap(struct iommu_domain *domain, | |||
| 107 | return iommu_ops->domain_has_cap(domain, cap); | 93 | return iommu_ops->domain_has_cap(domain, cap); |
| 108 | } | 94 | } |
| 109 | EXPORT_SYMBOL_GPL(iommu_domain_has_cap); | 95 | EXPORT_SYMBOL_GPL(iommu_domain_has_cap); |
| 96 | |||
| 97 | int iommu_map(struct iommu_domain *domain, unsigned long iova, | ||
| 98 | phys_addr_t paddr, int gfp_order, int prot) | ||
| 99 | { | ||
| 100 | unsigned long invalid_mask; | ||
| 101 | size_t size; | ||
| 102 | |||
| 103 | size = 0x1000UL << gfp_order; | ||
| 104 | invalid_mask = size - 1; | ||
| 105 | |||
| 106 | BUG_ON((iova | paddr) & invalid_mask); | ||
| 107 | |||
| 108 | return iommu_ops->map(domain, iova, paddr, gfp_order, prot); | ||
| 109 | } | ||
| 110 | EXPORT_SYMBOL_GPL(iommu_map); | ||
| 111 | |||
| 112 | int iommu_unmap(struct iommu_domain *domain, unsigned long iova, int gfp_order) | ||
| 113 | { | ||
| 114 | unsigned long invalid_mask; | ||
| 115 | size_t size; | ||
| 116 | |||
| 117 | size = 0x1000UL << gfp_order; | ||
| 118 | invalid_mask = size - 1; | ||
| 119 | |||
| 120 | BUG_ON(iova & invalid_mask); | ||
| 121 | |||
| 122 | return iommu_ops->unmap(domain, iova, gfp_order); | ||
| 123 | } | ||
| 124 | EXPORT_SYMBOL_GPL(iommu_unmap); | ||
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 4b4b565c835f..c5fbe198fbdb 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
| @@ -187,7 +187,7 @@ EXPORT_SYMBOL_GPL(platform_device_alloc); | |||
| 187 | * released. | 187 | * released. |
| 188 | */ | 188 | */ |
| 189 | int platform_device_add_resources(struct platform_device *pdev, | 189 | int platform_device_add_resources(struct platform_device *pdev, |
| 190 | struct resource *res, unsigned int num) | 190 | const struct resource *res, unsigned int num) |
| 191 | { | 191 | { |
| 192 | struct resource *r; | 192 | struct resource *r; |
| 193 | 193 | ||
| @@ -367,7 +367,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister); | |||
| 367 | */ | 367 | */ |
| 368 | struct platform_device *platform_device_register_simple(const char *name, | 368 | struct platform_device *platform_device_register_simple(const char *name, |
| 369 | int id, | 369 | int id, |
| 370 | struct resource *res, | 370 | const struct resource *res, |
| 371 | unsigned int num) | 371 | unsigned int num) |
| 372 | { | 372 | { |
| 373 | struct platform_device *pdev; | 373 | struct platform_device *pdev; |
