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

Wei Yongjun weiyongjun at huaweicloud.com
Thu Sep 22 14:12:03 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 abt-y030xx067a has no spi_device_id for abt,y030xx067a

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

diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
index 1cc0f1d09684..eec5b3a25045 100644
--- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
+++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
@@ -368,6 +368,12 @@ static const struct of_device_id y030xx067a_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, y030xx067a_of_match);
 
+static const struct spi_device_id y030xx067a_ids[] = {
+	{ "y030xx067a" },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(spi, y030xx067a_ids);
+
 static struct spi_driver y030xx067a_driver = {
 	.driver = {
 		.name = "abt-y030xx067a",
@@ -375,6 +381,7 @@ static struct spi_driver y030xx067a_driver = {
 	},
 	.probe = y030xx067a_probe,
 	.remove = y030xx067a_remove,
+	.id_table = y030xx067a_ids,
 };
 module_spi_driver(y030xx067a_driver);
 
-- 
2.34.1



More information about the dri-devel mailing list