Skip to content

Commit 217d30b

Browse files
krzkjoergroedel
authored andcommitted
iommu/omap: Drop redundant check if ti,syscon-mmuconfig exists
The syscon_regmap_lookup_by_phandle() will fail if property does not exist, so doing of_property_read_bool() earlier is redundant. Drop that check and move error message to syscon_regmap_lookup_by_phandle() error case while converting it to dev_err_probe(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 86731a2 commit 217d30b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/iommu/omap-iommu.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,23 +1123,15 @@ static int omap_iommu_dra7_get_dsp_system_cfg(struct platform_device *pdev,
11231123
struct omap_iommu *obj)
11241124
{
11251125
struct device_node *np = pdev->dev.of_node;
1126-
int ret;
11271126

11281127
if (!of_device_is_compatible(np, "ti,dra7-dsp-iommu"))
11291128
return 0;
11301129

1131-
if (!of_property_read_bool(np, "ti,syscon-mmuconfig")) {
1132-
dev_err(&pdev->dev, "ti,syscon-mmuconfig property is missing\n");
1133-
return -EINVAL;
1134-
}
1135-
11361130
obj->syscfg =
11371131
syscon_regmap_lookup_by_phandle(np, "ti,syscon-mmuconfig");
1138-
if (IS_ERR(obj->syscfg)) {
1139-
/* can fail with -EPROBE_DEFER */
1140-
ret = PTR_ERR(obj->syscfg);
1141-
return ret;
1142-
}
1132+
if (IS_ERR(obj->syscfg))
1133+
return dev_err_probe(&pdev->dev, PTR_ERR(obj->syscfg),
1134+
"ti,syscon-mmuconfig property is missing\n");
11431135

11441136
if (of_property_read_u32_index(np, "ti,syscon-mmuconfig", 1,
11451137
&obj->id)) {

0 commit comments

Comments
 (0)