[PATCH v2 05/10] drm/panel: nv3052c: Silence no spi_device_id warning

Wei Yongjun weiyongjun at huaweicloud.com
Thu Sep 22 14:11:58 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 nv3052c has no spi_device_id for leadtek,ltk035c5444t

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-newvision-nv3052c.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
index cf078f0d3cd3..a523e1dd2b4c 100644
--- a/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
+++ b/drivers/gpu/drm/panel/panel-newvision-nv3052c.c
@@ -467,6 +467,12 @@ static const struct of_device_id nv3052c_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, nv3052c_of_match);
 
+static const struct spi_device_id nv3052c_ids[] = {
+	{ "ltk035c5444t" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(spi, nv3052c_ids);
+
 static struct spi_driver nv3052c_driver = {
 	.driver = {
 		.name = "nv3052c",
@@ -474,6 +480,7 @@ static struct spi_driver nv3052c_driver = {
 	},
 	.probe = nv3052c_probe,
 	.remove = nv3052c_remove,
+	.id_table = nv3052c_ids,
 };
 module_spi_driver(nv3052c_driver);
 
-- 
2.34.1



More information about the dri-devel mailing list