From: Wei Yongjun <[email protected]>

SPI devices use the spi_device_id for module autoloading even on
systems using device tree, after commit 5fa6863ba692 ("spi: Check
we have a spi_device_id for each DT compatible"), kernel warns as
follows since the spi_device_id is missing:

SPI driver panel-ilitek-ili9322 has no spi_device_id for dlink,dir-685-panel
SPI driver panel-ilitek-ili9322 has no spi_device_id for ilitek,ili9322

Add spi_device_id entries to silence the warnings, and ensure driver
module autoloading works.

Signed-off-by: Wei Yongjun <[email protected]>
---
 drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c 
b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
index 3dfafa585127..768721be4240 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c
@@ -933,9 +933,17 @@ static const struct of_device_id ili9322_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ili9322_of_match);
 
+static const struct spi_device_id ili9322_ids[] = {
+       { "dir-685-panel" },
+       { "ili9322" },
+       { }
+};
+MODULE_DEVICE_TABLE(spi, ili9322_ids);
+
 static struct spi_driver ili9322_driver = {
        .probe = ili9322_probe,
        .remove = ili9322_remove,
+       .id_table = ili9322_ids,
        .driver = {
                .name = "panel-ilitek-ili9322",
                .of_match_table = ili9322_of_match,
-- 
2.34.1

Reply via email to