Skip to content

Commit b65f501

Browse files
ArvindYadavCsjoergroedel
authored andcommitted
iommu/mediatek: Constify iommu_ops
iommu_ops are not supposed to change at runtime. Functions 'iommu_device_set_ops' and 'bus_set_iommu' working with const iommu_ops provided by <linux/iommu.h>. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Yong Wu <[email protected]> (Change the title to iommu/mediatek: xx) Signed-off-by: Joerg Roedel <[email protected]>
1 parent 6510223 commit b65f501

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct mtk_iommu_domain {
113113
struct iommu_domain domain;
114114
};
115115

116-
static struct iommu_ops mtk_iommu_ops;
116+
static const struct iommu_ops mtk_iommu_ops;
117117

118118
static LIST_HEAD(m4ulist); /* List all the M4U HWs */
119119

@@ -488,7 +488,7 @@ static int mtk_iommu_of_xlate(struct device *dev, struct of_phandle_args *args)
488488
return iommu_fwspec_add_ids(dev, args->args, 1);
489489
}
490490

491-
static struct iommu_ops mtk_iommu_ops = {
491+
static const struct iommu_ops mtk_iommu_ops = {
492492
.domain_alloc = mtk_iommu_domain_alloc,
493493
.domain_free = mtk_iommu_domain_free,
494494
.attach_dev = mtk_iommu_attach_device,

drivers/iommu/mtk_iommu_v1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static phys_addr_t mtk_iommu_iova_to_phys(struct iommu_domain *domain,
362362
return pa;
363363
}
364364

365-
static struct iommu_ops mtk_iommu_ops;
365+
static const struct iommu_ops mtk_iommu_ops;
366366

367367
/*
368368
* MTK generation one iommu HW only support one iommu domain, and all the client
@@ -524,7 +524,7 @@ static int mtk_iommu_hw_init(const struct mtk_iommu_data *data)
524524
return 0;
525525
}
526526

527-
static struct iommu_ops mtk_iommu_ops = {
527+
static const struct iommu_ops mtk_iommu_ops = {
528528
.domain_alloc = mtk_iommu_domain_alloc,
529529
.domain_free = mtk_iommu_domain_free,
530530
.attach_dev = mtk_iommu_attach_device,

0 commit comments

Comments
 (0)