[PATCH v2 06/10] drm/panel: s6d27a1: Silence no spi_device_id warning

Wei Yongjun weiyongjun at huaweicloud.com
Thu Sep 22 14:11:59 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 s6d27a1-panel has no spi_device_id for samsung,s6d27a1

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

Signed-off-by: Wei Yongjun <weiyongjun1 at huawei.com>
---
 drivers/gpu/drm/panel/panel-samsung-s6d27a1.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c
index 2adb223a895c..4e80ef81b282 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6d27a1.c
@@ -304,9 +304,16 @@ static const struct of_device_id s6d27a1_match[] = {
 };
 MODULE_DEVICE_TABLE(of, s6d27a1_match);
 
+static const struct spi_device_id s6d27a1_ids[] = {
+	{ "s6d27a1" },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(spi, s6d27a1_ids);
+
 static struct spi_driver s6d27a1_driver = {
 	.probe		= s6d27a1_probe,
 	.remove		= s6d27a1_remove,
+	.id_table	= s6d27a1_ids,
 	.driver		= {
 		.name	= "s6d27a1-panel",
 		.of_match_table = s6d27a1_match,
-- 
2.34.1



More information about the dri-devel mailing list