summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/nau7802.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-05-31 23:39:22 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-14 12:53:09 +0200
commitd34a1daf1a93b14d9bbab07e2f55336dec763407 (patch)
tree06bcb5b07080681f3912a1d2588115b37526b970 /drivers/iio/adc/nau7802.c
parentiio: adc: nau7802: Convert driver to use ->probe_new() (diff)
downloadlinux-d34a1daf1a93b14d9bbab07e2f55336dec763407.tar.xz
linux-d34a1daf1a93b14d9bbab07e2f55336dec763407.zip
iio: adc: nau7802: Make use of device properties
Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Add mod_devicetable.h include. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220531213922.72992-2-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/nau7802.c')
-rw-r--r--drivers/iio/adc/nau7802.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/adc/nau7802.c b/drivers/iio/adc/nau7802.c
index 2d71cdbcd82f..c1261ecd400c 100644
--- a/drivers/iio/adc/nau7802.c
+++ b/drivers/iio/adc/nau7802.c
@@ -8,10 +8,11 @@
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
+#include <linux/property.h>
#include <linux/wait.h>
#include <linux/log2.h>
-#include <linux/of.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
@@ -411,7 +412,6 @@ static int nau7802_probe(struct i2c_client *client)
{
struct iio_dev *indio_dev;
struct nau7802_state *st;
- struct device_node *np = client->dev.of_node;
int i, ret;
u8 data;
u32 tmp = 0;
@@ -451,7 +451,7 @@ static int nau7802_probe(struct i2c_client *client)
if (!(ret & NAU7802_PUCTRL_PUR_BIT))
return ret;
- of_property_read_u32(np, "nuvoton,vldo", &tmp);
+ device_property_read_u32(&client->dev, "nuvoton,vldo", &tmp);
st->vref_mv = tmp;
data = NAU7802_PUCTRL_PUD_BIT | NAU7802_PUCTRL_PUA_BIT |