From 59bf7790886ae1e5558b5508fc3e250ccd028d69 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 14 May 2024 10:49:33 +0800 Subject: [PATCH] ASoC: rockchip-spi-codec: Silence no spi_device_id warning 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 spi_codec has no spi_device_id for rockchip,spi-codec Add spi_device_id entries to silence the warning, and ensure driver module autoloading works. Signed-off-by: Tao Huang Change-Id: Ie33ffd25261376f55a16ae5a34ee0fafdb6e6cd6 --- sound/soc/codecs/rockchip-spi-codec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rockchip-spi-codec.c b/sound/soc/codecs/rockchip-spi-codec.c index bc89f8a9198c..457891df7d7c 100644 --- a/sound/soc/codecs/rockchip-spi-codec.c +++ b/sound/soc/codecs/rockchip-spi-codec.c @@ -351,12 +351,19 @@ static const struct of_device_id spi_codec_device_id[] = { }; MODULE_DEVICE_TABLE(of, spi_codec_device_id); +static const struct spi_device_id spi_codec_id[] = { + { "spi-codec" }, + {} +}; +MODULE_DEVICE_TABLE(spi, spi_codec_id); + static struct spi_driver spi_codec_driver = { .driver = { - .name = "spi_codec", + .name = "spi-codec", .owner = THIS_MODULE, .of_match_table = of_match_ptr(spi_codec_device_id), }, + .id_table = spi_codec_id, .probe = spi_codec_probe, .remove = spi_codec_remove, };