pci: layerscape: Adjust the return value when ls_pcie_addr_valid() fails
[oweals/u-boot.git] / drivers / pci / pci_rom.c
index a33efae2636a4593fdb366bd5c62a91e58cb506b..ad1167e2b65ad436824132eaf2d671b683d3151c 100644 (file)
 #include <video_fb.h>
 #include <linux/screen_info.h>
 
-#ifdef CONFIG_HAVE_ACPI_RESUME
-#include <asm/acpi.h>
-#endif
-
 __weak bool board_should_run_oprom(pci_dev_t dev)
 {
        return true;
@@ -44,10 +40,6 @@ __weak bool board_should_run_oprom(pci_dev_t dev)
 
 static bool should_load_oprom(pci_dev_t dev)
 {
-#ifdef CONFIG_HAVE_ACPI_RESUME
-       if (acpi_get_slp_type() == 3)
-               return false;
-#endif
        if (IS_ENABLED(CONFIG_ALWAYS_LOAD_OPROM))
                return 1;
        if (board_should_run_oprom(dev))
@@ -187,7 +179,7 @@ int pci_rom_load(struct pci_rom_header *rom_header,
        return 0;
 }
 
-static struct vbe_mode_info mode_info;
+struct vbe_mode_info mode_info;
 
 int vbe_get_video_info(struct graphic_device *gdev)
 {
@@ -232,9 +224,12 @@ int vbe_get_video_info(struct graphic_device *gdev)
 
 void setup_video(struct screen_info *screen_info)
 {
-#ifdef CONFIG_FRAMEBUFFER_SET_VESA_MODE
        struct vesa_mode_info *vesa = &mode_info.vesa;
 
+       /* Sanity test on VESA parameters */
+       if (!vesa->x_resolution || !vesa->y_resolution)
+               return;
+
        screen_info->orig_video_isVGA = VIDEO_TYPE_VLFB;
 
        screen_info->lfb_width = vesa->x_resolution;
@@ -254,7 +249,6 @@ void setup_video(struct screen_info *screen_info)
        screen_info->blue_pos = vesa->blue_mask_pos;
        screen_info->rsvd_size = vesa->reserved_mask_size;
        screen_info->rsvd_pos = vesa->reserved_mask_pos;
-#endif
 }
 
 int pci_run_vga_bios(pci_dev_t dev, int (*int15_handler)(void), int exec_method)