Skip to contentSkip to conversation

staging: iio: ad5933: finalized device-tree support

PATCH Superseded Marcelo Schmitt 3 participants 3 messages Nov 23, 2018 – Nov 24, 2018

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: iio: ad5933: finalized device-tree support

Added a of_device_id struct variable and subsequent call to MODULE_DEVICE_TABLE macro to complete device-tree support for this driver.

---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/staging/iio/impedance-analyzer/ad5933.c +9 -0
index edb8b540bbf1..19e8b6d2865c 100644
@@ -771,9 +771,18 @@ static const struct i2c_device_id ad5933_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad5933_id);
 
+static const struct of_device_id ad5933_of_match[] = {
+	{ .compatible = "analog-devices,ad5933" },
+	{ .compatible = "analog-devices,ad5934" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, ad5933_of_match);
+
 static struct i2c_driver ad5933_driver = {
 	.driver = {
 		.name = "ad5933",
+		.of_match_table = ad5933_of_match,
 	},
 	.probe = ad5933_probe,
 	.remove = ad5933_remove,
Signature · 1 line
2.17.1
#1 lore raw

Hi Marcelo,

I believe that a proper commit message for this patch could be something like "Add device tree support".

Quoted 41 lines · Marcelo Schmitt

Added a of_device_id struct variable and subsequent call to MODULE_DEVICE_TABLE macro to complete device-tree support for this driver.

---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/staging/iio/impedance-analyzer/ad5933.c +9 -0
index edb8b540bbf1..19e8b6d2865c 100644
@@ -771,9 +771,18 @@ static const struct i2c_device_id ad5933_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad5933_id);
 
+static const struct of_device_id ad5933_of_match[] = {
+	{ .compatible = "analog-devices,ad5933" },
+	{ .compatible = "analog-devices,ad5934" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, ad5933_of_match);
+
 static struct i2c_driver ad5933_driver = {
 	.driver = {
 		.name = "ad5933",
+		.of_match_table = ad5933_of_match,
 	},
 	.probe = ad5933_probe,
 	.remove = ad5933_remove,
Signature · 8 lines
2.17.1

-- 
You received this message because you are subscribed to the Google Groups "Kernel USP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/kernel-usp/20181123235159.hh43xnvvwsil4on2%40smtp.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Signature · 6 lines
Rodrigo Siqueira
https://siqueira.tech
https://twitter.com/siqueirajordao
Graduate Student
Department of Computer Science
University of São Paulo
#2 lore raw
In reply to Marcelo Schmitt
Quoted 14 lines · Marcelo Schmitt

Added a of_device_id struct variable and subsequent call to MODULE_DEVICE_TABLE macro to complete device-tree support for this driver.

---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/staging/iio/impedance-analyzer/ad5933.c +0 -0
index edb8b540bbf1..19e8b6d2865c 100644

drivers/staging/iio/impedance-analyzer/ad5933.c static const struct i2c_device_id ad5933_id[] = { · line 776

Quoted 6 lines
drivers/staging/iio/impedance-analyzer/ad5933.c +3 -0
@@ -771,9 +771,18 @@ static const struct i2c_device_id ad5933_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, ad5933_id);
 
+static const struct of_device_id ad5933_of_match[] = {
+	{ .compatible = "analog-devices,ad5933" },
+	{ .compatible = "analog-devices,ad5934" },

Why "analog-devices", rather than "adi"? My understanding is that analog devices have "adi" as a manufacture part in compatible.

Quoted 12 lines
drivers/staging/iio/impedance-analyzer/ad5933.c +6 -0
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, ad5933_of_match);
+
 static struct i2c_driver ad5933_driver = {
 	.driver = {
 		.name = "ad5933",
+		.of_match_table = ad5933_of_match,
 	},
 	.probe = ad5933_probe,
 	.remove = ad5933_remove,
Signature · 1 line
Slawomir Stepien