tegra20: display: fix checking of return value

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>
This commit is contained in:
Jeroen Hofstee 2014-06-11 23:12:28 +02:00 committed by Tom Warren
parent 0a26e1d6c3
commit c42ff090e4
1 changed files with 1 additions and 1 deletions

View 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;
}