Skip to content

Commit 26d1c1f

Browse files
krzkjoergroedel
authored andcommitted
iommu/omap: Use syscon_regmap_lookup_by_phandle_args
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. There is also no real benefit in printing errors on missing syscon argument, because this is done just too late: runtime check on static/build-time data. Dtschema and Devicetree bindings offer the static/build-time check for this already. Reviewed-by: Robin Murphy <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 217d30b commit 26d1c1f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/iommu/omap-iommu.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,18 +1127,12 @@ static int omap_iommu_dra7_get_dsp_system_cfg(struct platform_device *pdev,
11271127
if (!of_device_is_compatible(np, "ti,dra7-dsp-iommu"))
11281128
return 0;
11291129

1130-
obj->syscfg =
1131-
syscon_regmap_lookup_by_phandle(np, "ti,syscon-mmuconfig");
1130+
obj->syscfg = syscon_regmap_lookup_by_phandle_args(np, "ti,syscon-mmuconfig",
1131+
1, &obj->id);
11321132
if (IS_ERR(obj->syscfg))
11331133
return dev_err_probe(&pdev->dev, PTR_ERR(obj->syscfg),
11341134
"ti,syscon-mmuconfig property is missing\n");
11351135

1136-
if (of_property_read_u32_index(np, "ti,syscon-mmuconfig", 1,
1137-
&obj->id)) {
1138-
dev_err(&pdev->dev, "couldn't get the IOMMU instance id within subsystem\n");
1139-
return -EINVAL;
1140-
}
1141-
11421136
if (obj->id != 0 && obj->id != 1) {
11431137
dev_err(&pdev->dev, "invalid IOMMU instance id\n");
11441138
return -EINVAL;

0 commit comments

Comments
 (0)