Skip to contentSkip to conversation

iio: dac: ad8460: add SPI device match table

PATCH Applied David Lechner 2 participants 2 messages Oct 18, 2024 – Oct 19, 2024

Subsystems (3)
lore
Share & tools
lore

David Lechner

author reviewer
#0 lore raw

PATCH 1/1 iio: dac: ad8460: add SPI device match table

Add SPI device match table for ADI AD8460 DAC. As described in [1], this is required for the module to automatically load, even when using DT.

[1]: https://lore.kernel.org/all/[email protected]/

---
 drivers/iio/dac/ad8460.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/iio/dac/ad8460.c +7 -0
index dc8c76ba573d..ded442d4060d 100644
@@ -929,12 +929,19 @@ static const struct of_device_id ad8460_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ad8460_of_match);
 
+static const struct spi_device_id ad8460_spi_match[] = {
+	{ .name = "ad8460" },
+	{ }
+};
+MODULE_DEVICE_TABLE(spi, ad8460_spi_match);
+
 static struct spi_driver ad8460_driver = {
 	.driver = {
 		.name = "ad8460",
 		.of_match_table = ad8460_of_match,
 	},
 	.probe = ad8460_probe,
+	.id_table = ad8460_spi_match,
 };
 module_spi_driver(ad8460_driver);
 

---
base-commit: f2493655d2d3d5c6958ed996b043c821c23ae8d3
change-id: 20241018-iio-dac-ad8460-add-spi-match-table-906dd36cb033

Best regards,

Signature · 1 line
David Lechner <[email protected]>
maintainer Applied
#1 lore raw
Quoted 6 lines · On Fri, 18 Oct 2024 16:44:48 -0500 David Lechner <[email protected]> wrote:

Add SPI device match table for ADI AD8460 DAC. As described in [1], this is required for the module to automatically load, even when using DT.

[1]: https://lore.kernel.org/all/[email protected]/

One day I'll remember to check for this when reviewing.

This is actually another corner case and fine for now. In the link you reference check the driver name matching just before the warning print.

That works if there is only one ID. Still better to clean this up as a form of hardening against future problems.

Applied.

Jonathan

Quoted 34 lines
---
 drivers/iio/dac/ad8460.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/iio/dac/ad8460.c +7 -1
index dc8c76ba573d..ded442d4060d 100644
@@ -929,12 +929,19 @@ static const struct of_device_id ad8460_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ad8460_of_match);
 
+static const struct spi_device_id ad8460_spi_match[] = {
+	{ .name = "ad8460" },
+	{ }
+};
+MODULE_DEVICE_TABLE(spi, ad8460_spi_match);
+
 static struct spi_driver ad8460_driver = {
 	.driver = {
 		.name = "ad8460",
 		.of_match_table = ad8460_of_match,
 	},
 	.probe = ad8460_probe,
+	.id_table = ad8460_spi_match,
 };
 module_spi_driver(ad8460_driver);
 
 
---

base-commit: f2493655d2d3d5c6958ed996b043c821c23ae8d3
change-id: 20241018-iio-dac-ad8460-add-spi-match-table-906dd36cb033

Best regards,