Skip to contentSkip to conversation

iio: temperature: max31865: Make use of device properties

PATCH In review Andy Shevchenko 3 participants 4 messages Apr 13, 2022 – Apr 28, 2022 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: temperature: max31865: Make use of device properties

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

---
 drivers/iio/temperature/max31865.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/temperature/max31865.c +3 -1
index 86c3f3509a26..e3bb78184c6e 100644
@@ -12,9 +12,11 @@
 #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 {
Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 2 lines · On Wed, 13 Apr 2022 21:53:35 +0300 Andy Shevchenko…

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

This one should call out the addition of missing mod_devicetable.h If nothing else comes up I can add that whilst applying. Looks fine to me but I'd like to give a little time for Navin to comment if they wish.

Jonathan

Quoted 31 lines
---
 drivers/iio/temperature/max31865.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/temperature/max31865.c +3 -1
index 86c3f3509a26..e3bb78184c6e 100644
@@ -12,9 +12,11 @@
 #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 {
#2 lore raw
Quoted 11 lines · Jonathan Cameron
Quoted 2 lines · On Wed, 13 Apr 2022 21:53:35 +0300 Andy Shevchenko…

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

This one should call out the addition of missing mod_devicetable.h If nothing else comes up I can add that whilst applying. Looks fine to me but I'd like to give a little time for Navin to comment if they wish.

Jonathan

Looks fine for me. Thanks

Navin

Quoted 31 lines
Quoted 31 lines
---
  drivers/iio/temperature/max31865.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/temperature/max31865.c +3 -1
index 86c3f3509a26..e3bb78184c6e 100644
@@ -12,9 +12,11 @@
  #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 {
maintainer
#3 lore raw
Quoted 6 lines · On Tue, 26 Apr 2022 16:47:20 +0200 navin <[email protected]> wrote:
Quoted 5 lines · Jonathan Cameron
Quoted 2 lines · On Wed, 13 Apr 2022 21:53:35 +0300 Andy Shevchenko…

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

Quoted 8 lines
Quoted 6 lines

This one should call out the addition of missing mod_devicetable.h If nothing else comes up I can add that whilst applying. Looks fine to me but I'd like to give a little time for Navin to comment if they wish.

Jonathan

Looks fine for me. Thanks

Thanks,

Applied to the togreg branch of iio.git and pushed out as testing for 0-day to poke at it.

Thanks,

Jonathan

Quoted 34 lines

Navin

Quoted 31 lines
Quoted 31 lines
---
  drivers/iio/temperature/max31865.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iio/temperature/max31865.c +3 -1
index 86c3f3509a26..e3bb78184c6e 100644
@@ -12,9 +12,11 @@
  #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 {