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

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 <krzysztof.kozlowski@linaro.org>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Krzysztof Kozlowski and committed by
Helge Deller
3a48b38f 65ea3b4d

+2 -7
+2 -7
drivers/video/fbdev/omap2/omapfb/dss/dispc.c
··· 3934 3934 } 3935 3935 3936 3936 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); 3938 3939 if (IS_ERR(dispc.syscon_pol)) { 3939 3940 dev_err(&pdev->dev, "failed to get syscon-pol regmap\n"); 3940 3941 return PTR_ERR(dispc.syscon_pol); 3941 - } 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 3942 } 3948 3943 } 3949 3944