video: vesa_fb: Fix wrong return value check of pci_find_class()
authorBin Meng <bmeng.cn@gmail.com>
Thu, 1 Oct 2015 07:36:00 +0000 (00:36 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 21 Oct 2015 13:46:25 +0000 (07:46 -0600)
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>
drivers/video/vesa_fb.c

index 4e6d070a5fefce337b5016f1213ac525e1020ac3..a19651f5f3ae0e6ef9df2b8885cc23525876ced5 100644 (file)
@@ -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;
                }