From: Andy Shevchenko Date: Wed, 13 Apr 2022 18:50:44 +0000 (+0300) Subject: iio: temperature: max31856: Make use of device properties X-Git-Tag: v6.6.17~7345^2~81^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60a0548f098a1d6b04554cc29159877721049bef;p=platform%2Fkernel%2Flinux-rpi.git 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 Link: https://lore.kernel.org/r/20220413185044.21588-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/temperature/max31856.c b/drivers/iio/temperature/max31856.c index 5484088..8307aae 100644 --- a/drivers/iio/temperature/max31856.c +++ b/drivers/iio/temperature/max31856.c @@ -7,9 +7,11 @@ */ #include +#include #include #include #include +#include #include #include #include @@ -422,9 +424,7 @@ static int max31856_probe(struct spi_device *spi) indio_dev->channels = max31856_channels; indio_dev->num_channels = ARRAY_SIZE(max31856_channels); - ret = of_property_read_u32(spi->dev.of_node, "thermocouple-type", - &data->thermocouple_type); - + ret = device_property_read_u32(&spi->dev, "thermocouple-type", &data->thermocouple_type); if (ret) { dev_info(&spi->dev, "Could not read thermocouple type DT property, configuring as a K-Type\n");