Skip to content

Commit 21fd9be

Browse files
AngeloGioacchino Del Regnojoergroedel
authored andcommitted
iommu/mediatek: Cleanup pericfg lookup flow
Since only the INFRA type IOMMU needs to modify register(s) in the pericfg iospace, it's safe to drop the pericfg_comp_str NULL check; also, directly assign the regmap handle to data->pericfg instead of to the infracfg variable to improve code readability. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Link: https://lore.kernel.org/r/20220616110830.26037-6-angelogioacchino.delregno@collabora.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 7d748ff commit 21fd9be

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,15 +1217,13 @@ static int mtk_iommu_probe(struct platform_device *pdev)
12171217
dev_err(dev, "mm dts parse fail(%d).", ret);
12181218
goto out_runtime_disable;
12191219
}
1220-
} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA) &&
1221-
data->plat_data->pericfg_comp_str) {
1222-
infracfg = syscon_regmap_lookup_by_compatible(data->plat_data->pericfg_comp_str);
1223-
if (IS_ERR(infracfg)) {
1224-
ret = PTR_ERR(infracfg);
1220+
} else if (MTK_IOMMU_IS_TYPE(data->plat_data, MTK_IOMMU_TYPE_INFRA)) {
1221+
p = data->plat_data->pericfg_comp_str;
1222+
data->pericfg = syscon_regmap_lookup_by_compatible(p);
1223+
if (IS_ERR(data->pericfg)) {
1224+
ret = PTR_ERR(data->pericfg);
12251225
goto out_runtime_disable;
12261226
}
1227-
1228-
data->pericfg = infracfg;
12291227
}
12301228

12311229
platform_set_drvdata(pdev, data);

0 commit comments

Comments
 (0)