All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] iio: temperature: max31856: Make use of device properties
@ 2022-04-13 18:50 Andy Shevchenko
  2022-04-16 10:52 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2022-04-13 18:50 UTC (permalink / raw)
  To: linux-iio, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen, Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/temperature/max31856.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/temperature/max31856.c b/drivers/iio/temperature/max31856.c
index 54840881259a..8307aae2cb45 100644
--- a/drivers/iio/temperature/max31856.c
+++ b/drivers/iio/temperature/max31856.c
@@ -7,9 +7,11 @@
  */
 
 #include <linux/ctype.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/err.h>
+#include <linux/property.h>
 #include <linux/spi/spi.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -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");
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] iio: temperature: max31856: Make use of device properties
  2022-04-13 18:50 [PATCH v1 1/1] iio: temperature: max31856: Make use of device properties Andy Shevchenko
@ 2022-04-16 10:52 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-04-16 10:52 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-iio, linux-kernel, Lars-Peter Clausen, Andrea Merello,
	Paresh Chaudhary

On Wed, 13 Apr 2022 21:50:44 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Convert the module to be property provider agnostic and allow
> it to be used on non-OF platforms.
> 
Added note on addition of mod_devicetable.h include.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+CC Andrea and Paresh

Seems straight forward so I've applied it but there is still time for
others to take a look.

Thanks,

Jonathan

> ---
>  drivers/iio/temperature/max31856.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/temperature/max31856.c b/drivers/iio/temperature/max31856.c
> index 54840881259a..8307aae2cb45 100644
> --- a/drivers/iio/temperature/max31856.c
> +++ b/drivers/iio/temperature/max31856.c
> @@ -7,9 +7,11 @@
>   */
>  
>  #include <linux/ctype.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/err.h>
> +#include <linux/property.h>
>  #include <linux/spi/spi.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> @@ -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");


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-16 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 18:50 [PATCH v1 1/1] iio: temperature: max31856: Make use of device properties Andy Shevchenko
2022-04-16 10:52 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.