Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
d34a1daf d8600a18

+3 -3
+3 -3
drivers/iio/adc/nau7802.c
··· 8 8 #include <linux/delay.h> 9 9 #include <linux/i2c.h> 10 10 #include <linux/interrupt.h> 11 + #include <linux/mod_devicetable.h> 11 12 #include <linux/module.h> 13 + #include <linux/property.h> 12 14 #include <linux/wait.h> 13 15 #include <linux/log2.h> 14 - #include <linux/of.h> 15 16 16 17 #include <linux/iio/iio.h> 17 18 #include <linux/iio/sysfs.h> ··· 412 411 { 413 412 struct iio_dev *indio_dev; 414 413 struct nau7802_state *st; 415 - struct device_node *np = client->dev.of_node; 416 414 int i, ret; 417 415 u8 data; 418 416 u32 tmp = 0; ··· 451 451 if (!(ret & NAU7802_PUCTRL_PUR_BIT)) 452 452 return ret; 453 453 454 - of_property_read_u32(np, "nuvoton,vldo", &tmp); 454 + device_property_read_u32(&client->dev, "nuvoton,vldo", &tmp); 455 455 st->vref_mv = tmp; 456 456 457 457 data = NAU7802_PUCTRL_PUD_BIT | NAU7802_PUCTRL_PUA_BIT |