From: Bin Meng Date: Thu, 1 Oct 2015 07:36:00 +0000 (-0700) Subject: video: vesa_fb: Fix wrong return value check of pci_find_class() X-Git-Tag: v2016.01-rc1~298^2~54 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=af67e7ce237fa0956168efca7909458d4ea93d4b;p=u-boot 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 Acked-by: Simon Glass Acked-by: Anatolij Gustschin --- diff --git a/drivers/video/vesa_fb.c b/drivers/video/vesa_fb.c index 4e6d070a5f..a19651f5f3 100644 --- a/drivers/video/vesa_fb.c +++ b/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; }