diff options
author | Robin Murphy <Robin.Murphy@arm.com> | 2016-04-07 13:42:05 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2016-05-09 09:33:29 -0400 |
commit | 53c92d793395fdab9edbd2f79b084bb6b2e6ae79 (patch) | |
tree | 57a3dd2ec3c8c3b280adab8dbe400c8c19345b40 /drivers/iommu/of_iommu.c | |
parent | 3c3e8943ac6f36ca5d18ca61b30634fb560b4ebb (diff) |
iommu: of: enforce const-ness of struct iommu_ops
As a set of driver-provided callbacks and static data, there is no
compelling reason for struct iommu_ops to be mutable in core code, so
enforce const-ness throughout.
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/of_iommu.c')
-rw-r--r-- | drivers/iommu/of_iommu.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 5fea665af99d..af499aea0a1a 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c | |||
@@ -98,12 +98,12 @@ EXPORT_SYMBOL_GPL(of_get_dma_window); | |||
98 | struct of_iommu_node { | 98 | struct of_iommu_node { |
99 | struct list_head list; | 99 | struct list_head list; |
100 | struct device_node *np; | 100 | struct device_node *np; |
101 | struct iommu_ops *ops; | 101 | const struct iommu_ops *ops; |
102 | }; | 102 | }; |
103 | static LIST_HEAD(of_iommu_list); | 103 | static LIST_HEAD(of_iommu_list); |
104 | static DEFINE_SPINLOCK(of_iommu_lock); | 104 | static DEFINE_SPINLOCK(of_iommu_lock); |
105 | 105 | ||
106 | void of_iommu_set_ops(struct device_node *np, struct iommu_ops *ops) | 106 | void of_iommu_set_ops(struct device_node *np, const struct iommu_ops *ops) |
107 | { | 107 | { |
108 | struct of_iommu_node *iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); | 108 | struct of_iommu_node *iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); |
109 | 109 | ||
@@ -119,10 +119,10 @@ void of_iommu_set_ops(struct device_node *np, struct iommu_ops *ops) | |||
119 | spin_unlock(&of_iommu_lock); | 119 | spin_unlock(&of_iommu_lock); |
120 | } | 120 | } |
121 | 121 | ||
122 | struct iommu_ops *of_iommu_get_ops(struct device_node *np) | 122 | const struct iommu_ops *of_iommu_get_ops(struct device_node *np) |
123 | { | 123 | { |
124 | struct of_iommu_node *node; | 124 | struct of_iommu_node *node; |
125 | struct iommu_ops *ops = NULL; | 125 | const struct iommu_ops *ops = NULL; |
126 | 126 | ||
127 | spin_lock(&of_iommu_lock); | 127 | spin_lock(&of_iommu_lock); |
128 | list_for_each_entry(node, &of_iommu_list, list) | 128 | list_for_each_entry(node, &of_iommu_list, list) |
@@ -134,12 +134,12 @@ struct iommu_ops *of_iommu_get_ops(struct device_node *np) | |||
134 | return ops; | 134 | return ops; |
135 | } | 135 | } |
136 | 136 | ||
137 | struct iommu_ops *of_iommu_configure(struct device *dev, | 137 | const struct iommu_ops *of_iommu_configure(struct device *dev, |
138 | struct device_node *master_np) | 138 | struct device_node *master_np) |
139 | { | 139 | { |
140 | struct of_phandle_args iommu_spec; | 140 | struct of_phandle_args iommu_spec; |
141 | struct device_node *np; | 141 | struct device_node *np; |
142 | struct iommu_ops *ops = NULL; | 142 | const struct iommu_ops *ops = NULL; |
143 | int idx = 0; | 143 | int idx = 0; |
144 | 144 | ||
145 | /* | 145 | /* |