iio: temperature: max31865: Make use of device properties
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 13 Apr 2022 18:53:35 +0000 (21:53 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 28 Apr 2022 18:30:19 +0000 (19:30 +0100)
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/20220413185335.21743-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/max31865.c

index 86c3f35..e3bb781 100644 (file)
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/init.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
+#include <linux/property.h>
 #include <linux/spi/spi.h>
 #include <asm/unaligned.h>
 
@@ -305,7 +307,7 @@ static int max31865_probe(struct spi_device *spi)
        indio_dev->channels = max31865_channels;
        indio_dev->num_channels = ARRAY_SIZE(max31865_channels);
 
-       if (of_property_read_bool(spi->dev.of_node, "maxim,3-wire")) {
+       if (device_property_read_bool(&spi->dev, "maxim,3-wire")) {
                /* select 3 wire */
                data->three_wire = 1;
        } else {