Skip to content

Commit 3a48b38

Browse files
krzkhdeller
authored andcommitted
fbdev: omapfb: 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. Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 65ea3b4 commit 3a48b38

File tree

1 file changed

+2
-7
lines changed
  • drivers/video/fbdev/omap2/omapfb/dss

1 file changed

+2
-7
lines changed

drivers/video/fbdev/omap2/omapfb/dss/dispc.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3934,17 +3934,12 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
39343934
}
39353935

39363936
if (np && of_property_present(np, "syscon-pol")) {
3937-
dispc.syscon_pol = syscon_regmap_lookup_by_phandle(np, "syscon-pol");
3937+
dispc.syscon_pol = syscon_regmap_lookup_by_phandle_args(np, "syscon-pol",
3938+
1, &dispc.syscon_pol_offset);
39383939
if (IS_ERR(dispc.syscon_pol)) {
39393940
dev_err(&pdev->dev, "failed to get syscon-pol regmap\n");
39403941
return PTR_ERR(dispc.syscon_pol);
39413942
}
3942-
3943-
if (of_property_read_u32_index(np, "syscon-pol", 1,
3944-
&dispc.syscon_pol_offset)) {
3945-
dev_err(&pdev->dev, "failed to get syscon-pol offset\n");
3946-
return -EINVAL;
3947-
}
39483943
}
39493944

39503945
pm_runtime_enable(&pdev->dev);

0 commit comments

Comments
 (0)