tegra20: display: fix checking of return value
authorJeroen Hofstee <jeroen@myspectrum.nl>
Wed, 11 Jun 2014 21:12:28 +0000 (23:12 +0200)
committerTom Warren <twarren@nvidia.com>
Thu, 19 Jun 2014 16:18:05 +0000 (09:18 -0700)
The calling code seems a bit in doubt about the return
value of fdtdec_lookup_phandle. Since it returns a negative
value on error (and fdt_node_offset_by_phandle as well),
check for that.

cc: Wei Ni <wni@nvidia.com>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/cpu/armv7/tegra20/display.c

index 488f0c639dd088d183ec1c2058e1f08d6e0df087..fd77f3f0eff368e5a0a83762390826b79f3eada3 100644 (file)
@@ -328,7 +328,7 @@ static int tegra_display_decode_config(const void *blob,
        rgb = fdt_subnode_offset(blob, node, "rgb");
 
        config->panel_node = fdtdec_lookup_phandle(blob, rgb, "nvidia,panel");
-       if (!config->panel_node < 0) {
+       if (config->panel_node < 0) {
                debug("%s: Cannot find panel information\n", __func__);
                return -1;
        }