summaryrefslogtreecommitdiff
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2021-03-14 18:15:07 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-04-07 08:36:37 +0100
commit89f2d5b080bc28f9b2f4b9a9b8f4ab594b63cdf6 (patch)
tree2d678a06813b496c20647334d858babbfae6cc02 /drivers/staging/iio
parenta9f8afe16412bc388a81269387d28c7319cb2c9e (diff)
staging:iio:cdc:ad7150: Add of_match_table
Rather than using the fallback path in the i2c subsystem and hoping for no clashes across vendors, lets put in an explicit table for matching. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Reviewed-by: Barry Song <song.bao.hua@hisilicon> Link: https://lore.kernel.org/r/20210314181511.531414-21-jic23@kernel.org
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/cdc/ad7150.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
index e27ed845879a..a25da31b6e65 100644
--- a/drivers/staging/iio/cdc/ad7150.c
+++ b/drivers/staging/iio/cdc/ad7150.c
@@ -12,6 +12,7 @@
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/mod_devicetable.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
@@ -650,9 +651,16 @@ static const struct i2c_device_id ad7150_id[] = {
MODULE_DEVICE_TABLE(i2c, ad7150_id);
+static const struct of_device_id ad7150_of_match[] = {
+ { "adi,ad7150" },
+ { "adi,ad7151" },
+ { "adi,ad7156" },
+ {}
+};
static struct i2c_driver ad7150_driver = {
.driver = {
.name = "ad7150",
+ .of_match_table = ad7150_of_match,
},
.probe = ad7150_probe,
.id_table = ad7150_id,