Skip to content

Commit 1ee9feb

Browse files
YongWu-HFjoergroedel
authored andcommitted
iommu/mediatek: Clean up struct mtk_smi_iommu
Remove the "struct mtk_smi_iommu" to simplify the code since it has only one item in it right now. Signed-off-by: Yong Wu <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent ec2da07 commit 1ee9feb

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

drivers/iommu/mtk_iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static void mtk_iommu_config(struct mtk_iommu_data *data,
278278
for (i = 0; i < fwspec->num_ids; ++i) {
279279
larbid = MTK_M4U_TO_LARB(fwspec->ids[i]);
280280
portid = MTK_M4U_TO_PORT(fwspec->ids[i]);
281-
larb_mmu = &data->smi_imu.larb_imu[larbid];
281+
larb_mmu = &data->larb_imu[larbid];
282282

283283
dev_dbg(dev, "%s iommu port: %d\n",
284284
enable ? "enable" : "disable", portid);
@@ -680,7 +680,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
680680
of_node_put(larbnode);
681681
return -EPROBE_DEFER;
682682
}
683-
data->smi_imu.larb_imu[id].dev = &plarbdev->dev;
683+
data->larb_imu[id].dev = &plarbdev->dev;
684684

685685
component_match_add_release(dev, &match, release_of,
686686
compare_of, larbnode);

drivers/iommu/mtk_iommu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ struct mtk_iommu_data {
5656
struct mtk_iommu_suspend_reg reg;
5757
struct mtk_iommu_domain *m4u_dom;
5858
struct iommu_group *m4u_group;
59-
struct mtk_smi_iommu smi_imu; /* SMI larb iommu info */
6059
bool enable_4GB;
6160
bool tlb_flush_active;
6261

6362
struct iommu_device iommu;
6463
const struct mtk_iommu_plat_data *plat_data;
6564

6665
struct list_head list;
66+
struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
6767
};
6868

6969
static inline int compare_of(struct device *dev, void *data)
@@ -80,14 +80,14 @@ static inline int mtk_iommu_bind(struct device *dev)
8080
{
8181
struct mtk_iommu_data *data = dev_get_drvdata(dev);
8282

83-
return component_bind_all(dev, &data->smi_imu);
83+
return component_bind_all(dev, &data->larb_imu);
8484
}
8585

8686
static inline void mtk_iommu_unbind(struct device *dev)
8787
{
8888
struct mtk_iommu_data *data = dev_get_drvdata(dev);
8989

90-
component_unbind_all(dev, &data->smi_imu);
90+
component_unbind_all(dev, &data->larb_imu);
9191
}
9292

9393
#endif

drivers/iommu/mtk_iommu_v1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static void mtk_iommu_config(struct mtk_iommu_data *data,
206206
for (i = 0; i < fwspec->num_ids; ++i) {
207207
larbid = mt2701_m4u_to_larb(fwspec->ids[i]);
208208
portid = mt2701_m4u_to_port(fwspec->ids[i]);
209-
larb_mmu = &data->smi_imu.larb_imu[larbid];
209+
larb_mmu = &data->larb_imu[larbid];
210210

211211
dev_dbg(dev, "%s iommu port: %d\n",
212212
enable ? "enable" : "disable", portid);
@@ -610,7 +610,7 @@ static int mtk_iommu_probe(struct platform_device *pdev)
610610
}
611611
}
612612

613-
data->smi_imu.larb_imu[larb_nr].dev = &plarbdev->dev;
613+
data->larb_imu[larb_nr].dev = &plarbdev->dev;
614614
component_match_add_release(dev, &match, release_of,
615615
compare_of, larb_spec.np);
616616
larb_nr++;

drivers/memory/mtk-smi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ static int
143143
mtk_smi_larb_bind(struct device *dev, struct device *master, void *data)
144144
{
145145
struct mtk_smi_larb *larb = dev_get_drvdata(dev);
146-
struct mtk_smi_iommu *smi_iommu = data;
146+
struct mtk_smi_larb_iommu *larb_mmu = data;
147147
unsigned int i;
148148

149149
for (i = 0; i < MTK_LARB_NR_MAX; i++) {
150-
if (dev == smi_iommu->larb_imu[i].dev) {
150+
if (dev == larb_mmu[i].dev) {
151151
larb->larbid = i;
152-
larb->mmu = &smi_iommu->larb_imu[i].mmu;
152+
larb->mmu = &larb_mmu[i].mmu;
153153
return 0;
154154
}
155155
}

include/soc/mediatek/smi.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ struct mtk_smi_larb_iommu {
2020
unsigned int mmu;
2121
};
2222

23-
struct mtk_smi_iommu {
24-
struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX];
25-
};
26-
2723
/*
2824
* mtk_smi_larb_get: Enable the power domain and clocks for this local arbiter.
2925
* It also initialize some basic setting(like iommu).

0 commit comments

Comments
 (0)