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

iio: temperature: max31856: Make use of device properties

Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Add missing mod_devicetable.h include.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220413185044.21588-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
60a0548f 811ffbad

+3 -3
+3 -3
drivers/iio/temperature/max31856.c
··· 7 7 */ 8 8 9 9 #include <linux/ctype.h> 10 + #include <linux/mod_devicetable.h> 10 11 #include <linux/module.h> 11 12 #include <linux/init.h> 12 13 #include <linux/err.h> 14 + #include <linux/property.h> 13 15 #include <linux/spi/spi.h> 14 16 #include <linux/iio/iio.h> 15 17 #include <linux/iio/sysfs.h> ··· 424 422 indio_dev->channels = max31856_channels; 425 423 indio_dev->num_channels = ARRAY_SIZE(max31856_channels); 426 424 427 - ret = of_property_read_u32(spi->dev.of_node, "thermocouple-type", 428 - &data->thermocouple_type); 429 - 425 + ret = device_property_read_u32(&spi->dev, "thermocouple-type", &data->thermocouple_type); 430 426 if (ret) { 431 427 dev_info(&spi->dev, 432 428 "Could not read thermocouple type DT property, configuring as a K-Type\n");