瀏覽代碼

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: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Bin Meng 9 年之前
父節點
當前提交
af67e7ce23
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/video/vesa_fb.c

+ 1 - 1
drivers/video/vesa_fb.c

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