Skip to contentSkip to conversation

staging: iio: adis16203: Add of_device_id table

PATCH Applied Thiago Estrela 2 participants 2 messages May 18, 2019 – May 19, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: iio: adis16203: Add of_device_id table

Accomplish device tree compatibility to driver ADIS16203 by adding of_device_id table and making a subsequent call to MODULE_DEVICE_TABLE.

---
 drivers/staging/iio/accel/adis16203.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/staging/iio/accel/adis16203.c +8 -0
index 70381756a64a..a5d974ac2e3b 100644
@@ -311,9 +311,17 @@ static int adis16203_remove(struct spi_device *spi)
 	return 0;
 }
 
+static const struct of_device_id adis16203_of_match[] = {
+	{ .compatible = "adi,adis16203" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, adis16203_of_match);
+
 static struct spi_driver adis16203_driver = {
 	.driver = {
 		.name = "adis16203",
+		.of_match_table = adis16203_of_match,
 	},
 	.probe = adis16203_probe,
 	.remove = adis16203_remove,
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 11 lines · On Sat, 18 May 2019 19:42:13 -0300 Thiago Estrela <[email protected]>…

Accomplish device tree compatibility to driver ADIS16203 by adding of_device_id table and making a subsequent call to MODULE_DEVICE_TABLE.

Another nice patch. Certainly seems like the dev day was successful and welcome to so many new people.

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to see if we missed anything.

Thanks,

Jonathan

Quoted 26 lines
---
 drivers/staging/iio/accel/adis16203.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/staging/iio/accel/adis16203.c +8 -0
index 70381756a64a..a5d974ac2e3b 100644
@@ -311,9 +311,17 @@ static int adis16203_remove(struct spi_device *spi)
 	return 0;
 }
 
+static const struct of_device_id adis16203_of_match[] = {
+	{ .compatible = "adi,adis16203" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, adis16203_of_match);
+
 static struct spi_driver adis16203_driver = {
 	.driver = {
 		.name = "adis16203",
+		.of_match_table = adis16203_of_match,
 	},
 	.probe = adis16203_probe,
 	.remove = adis16203_remove,