[PATCH v2 02/10] drm/panel: panel-ilitek-ili9322: Silence no spi_device_id warnings

Wei Yongjun weiyongjun at huaweicloud.com
Thu Sep 22 14:11:55 UTC 2022


From: Wei Yongjun <weiyongjun1 at huawei.com>

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 <weiyongjun1 at huawei.com>
---
 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



More information about the dri-devel mailing list