Skip to contentSkip to conversation

iio: adc: mcp3422: fix of match table

PATCH In review Angelo Compagnucci 2 participants 2 messages May 7, 2019 – May 11, 2019 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: adc: mcp3422: fix of match table

In order to support all the chip variants in dts, compatible should explicitly list all the variants and not only the base one.

---
 drivers/iio/adc/mcp3422.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/iio/adc/mcp3422.c +7 -0
index 63de705..91d6be3 100644
@@ -410,7 +410,14 @@ MODULE_DEVICE_TABLE(i2c, mcp3422_id);
 
 #ifdef CONFIG_OF
 static const struct of_device_id mcp3422_of_match[] = {
+	{ .compatible = "mcp3421" },
 	{ .compatible = "mcp3422" },
+	{ .compatible = "mcp3423" },
+	{ .compatible = "mcp3424" },
+	{ .compatible = "mcp3425" },
+	{ .compatible = "mcp3426" },
+	{ .compatible = "mcp3427" },
+	{ .compatible = "mcp3428" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mcp3422_of_match);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · On Tue, 7 May 2019 21:45:35 +0200 Angelo Compagnucci…

In order to support all the chip variants in dts, compatible should explicitly list all the variants and not only the base one.

These should have a manufacturer prefix.

Note that the fallback path to the id_table will work anyway for these devices so whilst it is good to tidy this up there isn't any great urgency.

Jonathan

Quoted 23 lines
---
 drivers/iio/adc/mcp3422.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/iio/adc/mcp3422.c +7 -0
index 63de705..91d6be3 100644
@@ -410,7 +410,14 @@ MODULE_DEVICE_TABLE(i2c, mcp3422_id);
 
 #ifdef CONFIG_OF
 static const struct of_device_id mcp3422_of_match[] = {
+	{ .compatible = "mcp3421" },
 	{ .compatible = "mcp3422" },
+	{ .compatible = "mcp3423" },
+	{ .compatible = "mcp3424" },
+	{ .compatible = "mcp3425" },
+	{ .compatible = "mcp3426" },
+	{ .compatible = "mcp3427" },
+	{ .compatible = "mcp3428" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mcp3422_of_match);