lkml.org 
[lkml]   [2018]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v2] staging: iio: ad5933: add device tree support
Add a of_device_id struct variable and subsequent call to
MODULE_DEVICE_TABLE macro to complete device tree support.

Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
---
drivers/staging/iio/impedance-analyzer/ad5933.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index edb8b540bbf1..6faa2700dc8d 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -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 = "adi,ad5933" },
+ { .compatible = "adi,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,
--
2.17.1
\
 
 \ /
  Last update: 2018-11-24 14:20    [W:0.025 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site