OpenCloudOS-Kernel/drivers/gpu/drm/solomon
Javier Martinez Canillas 01ece65132
drm/ssd130x: Only define a SPI device ID table when built as a module
The kernel test robot reports a compile warning due the ssd130x_spi_table
variable being defined but not used. This happen when ssd130x-spi driver
is built-in instead of being built as a module, i.e:

  CC      drivers/gpu/drm/solomon/ssd130x-spi.o
  AR      drivers/base/firmware_loader/built-in.a
  AR      drivers/base/built-in.a
  CC      kernel/trace/trace.o
drivers/gpu/drm/solomon/ssd130x-spi.c:155:35: warning: ‘ssd130x_spi_table’ defined but not used [-Wunused-const-variable=]
  155 | static const struct spi_device_id ssd130x_spi_table[] = {
      |                                   ^~~~~~~~~~~~~~~~~

The driver shouldn't need a SPI device ID table and only have an OF device
ID table, but the former is needed to workaround an issue in the SPI core.
This always reports a MODALIAS of the form "spi:<device>" even for devices
registered through Device Trees.

But the table is only needed when the driver built as a module to populate
the .ko alias info. It's not needed when the driver is built-in the kernel.

Fixes: 74373977d2 ("drm/solomon: Add SSD130x OLED displays SPI support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220530140246.742469-1-javierm@redhat.com
2022-06-02 00:35:32 +02:00
..
Kconfig drm/solomon: Add SSD130x OLED displays SPI support 2022-04-20 18:48:17 +02:00
Makefile drm/solomon: Add SSD130x OLED displays SPI support 2022-04-20 18:48:17 +02:00
ssd130x-i2c.c drm/ssd130x: Make ssd130x_remove() return void 2022-04-26 09:43:37 +02:00
ssd130x-spi.c drm/ssd130x: Only define a SPI device ID table when built as a module 2022-06-02 00:35:32 +02:00
ssd130x.c drm/ssd130x: Make ssd130x_remove() return void 2022-04-26 09:43:37 +02:00
ssd130x.h drm/ssd130x: Make ssd130x_remove() return void 2022-04-26 09:43:37 +02:00