Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <yong.wu@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>

authored by

Yong Wu and committed by
Joerg Roedel
1ee9feb2 ec2da07c

+10 -14
+2 -2
drivers/iommu/mtk_iommu.c
··· 278 278 for (i = 0; i < fwspec->num_ids; ++i) { 279 279 larbid = MTK_M4U_TO_LARB(fwspec->ids[i]); 280 280 portid = MTK_M4U_TO_PORT(fwspec->ids[i]); 281 - larb_mmu = &data->smi_imu.larb_imu[larbid]; 281 + larb_mmu = &data->larb_imu[larbid]; 282 282 283 283 dev_dbg(dev, "%s iommu port: %d\n", 284 284 enable ? "enable" : "disable", portid); ··· 680 680 of_node_put(larbnode); 681 681 return -EPROBE_DEFER; 682 682 } 683 - data->smi_imu.larb_imu[id].dev = &plarbdev->dev; 683 + data->larb_imu[id].dev = &plarbdev->dev; 684 684 685 685 component_match_add_release(dev, &match, release_of, 686 686 compare_of, larbnode);
+3 -3
drivers/iommu/mtk_iommu.h
··· 56 56 struct mtk_iommu_suspend_reg reg; 57 57 struct mtk_iommu_domain *m4u_dom; 58 58 struct iommu_group *m4u_group; 59 - struct mtk_smi_iommu smi_imu; /* SMI larb iommu info */ 60 59 bool enable_4GB; 61 60 bool tlb_flush_active; 62 61 ··· 63 64 const struct mtk_iommu_plat_data *plat_data; 64 65 65 66 struct list_head list; 67 + struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX]; 66 68 }; 67 69 68 70 static inline int compare_of(struct device *dev, void *data) ··· 80 80 { 81 81 struct mtk_iommu_data *data = dev_get_drvdata(dev); 82 82 83 - return component_bind_all(dev, &data->smi_imu); 83 + return component_bind_all(dev, &data->larb_imu); 84 84 } 85 85 86 86 static inline void mtk_iommu_unbind(struct device *dev) 87 87 { 88 88 struct mtk_iommu_data *data = dev_get_drvdata(dev); 89 89 90 - component_unbind_all(dev, &data->smi_imu); 90 + component_unbind_all(dev, &data->larb_imu); 91 91 } 92 92 93 93 #endif
+2 -2
drivers/iommu/mtk_iommu_v1.c
··· 206 206 for (i = 0; i < fwspec->num_ids; ++i) { 207 207 larbid = mt2701_m4u_to_larb(fwspec->ids[i]); 208 208 portid = mt2701_m4u_to_port(fwspec->ids[i]); 209 - larb_mmu = &data->smi_imu.larb_imu[larbid]; 209 + larb_mmu = &data->larb_imu[larbid]; 210 210 211 211 dev_dbg(dev, "%s iommu port: %d\n", 212 212 enable ? "enable" : "disable", portid); ··· 610 610 } 611 611 } 612 612 613 - data->smi_imu.larb_imu[larb_nr].dev = &plarbdev->dev; 613 + data->larb_imu[larb_nr].dev = &plarbdev->dev; 614 614 component_match_add_release(dev, &match, release_of, 615 615 compare_of, larb_spec.np); 616 616 larb_nr++;
+3 -3
drivers/memory/mtk-smi.c
··· 143 143 mtk_smi_larb_bind(struct device *dev, struct device *master, void *data) 144 144 { 145 145 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; 147 147 unsigned int i; 148 148 149 149 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) { 151 151 larb->larbid = i; 152 - larb->mmu = &smi_iommu->larb_imu[i].mmu; 152 + larb->mmu = &larb_mmu[i].mmu; 153 153 return 0; 154 154 } 155 155 }
-4
include/soc/mediatek/smi.h
··· 20 20 unsigned int mmu; 21 21 }; 22 22 23 - struct mtk_smi_iommu { 24 - struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX]; 25 - }; 26 - 27 23 /* 28 24 * mtk_smi_larb_get: Enable the power domain and clocks for this local arbiter. 29 25 * It also initialize some basic setting(like iommu).