drivers/firmware: fix SYSFB depends to prevent build failures
authorJavier Martinez Canillas <javierm@redhat.com>
Tue, 27 Jul 2021 09:30:15 +0000 (11:30 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 27 Jul 2021 09:50:24 +0000 (11:50 +0200)
commit71260b9a7020751623bcda2a5377834a100dfb30
tree0fb5787f5ccef3c16dc6b068ddd43355569fb7f1
parent35482f9dc56b9bd0f179106da7e461f6c2a2d891
drivers/firmware: fix SYSFB depends to prevent build failures

The Generic System Framebuffers support is built when the COMPILE_TEST
option is enabled. But this wrongly assumes that all the architectures
declare a struct screen_info.

This is true for most architectures, but at least the following do not:
arc, m68k, microblaze, openrisc, parisc and s390.

By attempting to make this compile testeable on all architectures, it
leads to linking errors as reported by the kernel test robot for parisc:

  All errors (new ones prefixed by >>):

     hppa-linux-ld: drivers/firmware/sysfb.o: in function `sysfb_init':
     (.init.text+0x24): undefined reference to `screen_info'
  >> hppa-linux-ld: (.init.text+0x28): undefined reference to `screen_info'

To prevent these errors only allow sysfb to be built on systems that are
going to need it, which are x86 BIOS and EFI.

The EFI Kconfig symbol is used instead of (ARM || ARM64 || RISC) because
some of these architectures only declare a struct screen_info if EFI is
enabled. And also, because the SYSFB code is only used for EFI on these
architectures. For !EFI the "simple-framebuffer" device is registered by
OF when parsing the Device Tree Blob (if a DT node for this was defined).

Fixes: d391c5827107 ("drivers/firmware: move x86 Generic System Framebuffers support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210727093015.1225107-1-javierm@redhat.com
drivers/firmware/Kconfig