提交 af67e7ce 编写于 作者: B Bin Meng 提交者: Simon Glass

video: vesa_fb: Fix wrong return value check of pci_find_class()

When pci_find_class() fails to find a device, it returns -ENODEV.
But now we check the return value against -1. Fix it.
Signed-off-by: NBin Meng <bmeng.cn@gmail.com>
Acked-by: NSimon Glass <sjg@chromium.org>
Acked-by: NAnatolij Gustschin <agust@denx.de>
上级 cdf9f085
......@@ -34,7 +34,7 @@ void *video_hw_init(void)
}
if (vbe_get_video_info(gdev)) {
dev = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, 0);
if (dev == -1) {
if (dev < 0) {
printf("no card detected\n");
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册