linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/38] iio: remaining easy of_match_ptr removal and related.
@ 2020-09-10 17:32 Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 01/38] iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
                   ` (38 more replies)
  0 siblings, 39 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This bumper set removes all the remaining cases where of_match_ptr
is mostly serving to prevent use of the device via ACPI PRP0001 and
complicating the code. The main aim of this set is to reduce the chances
of it being used in future drivers.
It also includes some related refactorings, use of generic fw accessors,
dropping of CONFIG_OF and lots of header changes inline with the above.

For examples of how to use PRP0001 see https://github.com/westeri/meta-acpi
which is an excellent resource from which to copy snippets of DSDT tables.

It may well not be worth changing the remaining 10 IIO drivers and I
certainly don't plan to do so anytime soon.

Jonathan Cameron (38):
  iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections.
  iio:potentiometer:ds1803: Drop of_match_ptr and CONFIG_OF protections
  iio:potentiometer:max5432: Drop of_match_ptr and use generic fw
    accessors
  iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF
    protections.
  iio:potentiometer:max5481: Drop invalid ACPI binding.
  iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF
    protections.
  iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw
    interfaces.
  iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF
    protections.
  iio:dac:ad5446: Drop of_match_ptr and CONFIG_OF protections
  iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections.
  iio:dac:ad5593r: Drop of_match_ptr and ACPI_PTR protections.
  iio:dac:ad7303: Drop of_match_ptr protection
  iio:dac:mcp4725: drop of_match_ptr and use generic fw properties
  iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections
  iio:dac:ti-dac5571: Drop of_match_ptr and CONFIG_OF protections
  iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw
    accessors
  iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections
  iio:pressure:ms5611: Drop of_match_ptr and CONFIG_OF protections
  iio:pressure:ms5637: Drop of_match_ptr protection
  iio:pressure:zpa2326: Drop of_match_ptr protection
  iio:temperature:tsys01: Drop of_match_ptr protection
  iio:temperature:tmp007: Drop of_match_ptr protection
  iio:resolver:ad2s1200: Drop of_match_ptr protection
  iio:chemical:ams-iaq-core: Drop of_match_ptr protection
  iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw
    accessors
  iio:chemical:sgp30: Use local variable dev to simplify code
  iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors
  iio:chemical:vz89x: Introduce local struct device pointer.
  iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw
    accessors
  iio:humidity:hdc100x: Drop of_match_ptr protection.
  iio:proximity:as3935: Use local struct device pointer to simplify
    code.
  iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors
  iio:proximity:pulsedlight: Drop of_match_ptr protection
  iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.
  iio:magn:ak8974: Drop of_match_ptr protection
  iio:humidity:htu21: Drop of_match_ptr protection
  iio:humidity:si7020: Drop of_match_ptr protection
  iio:health:max30102: Drop of_match_ptr and use generic fw accessors

 drivers/iio/chemical/ams-iaq-core.c           |  3 +-
 drivers/iio/chemical/atlas-sensor.c           | 10 ++---
 drivers/iio/chemical/sgp30.c                  | 28 ++++++------
 drivers/iio/chemical/vz89x.c                  | 18 ++++----
 drivers/iio/dac/ad5446.c                      |  5 +--
 drivers/iio/dac/ad5592r.c                     |  7 ++-
 drivers/iio/dac/ad5593r.c                     |  7 ++-
 drivers/iio/dac/ad7303.c                      |  3 +-
 drivers/iio/dac/mcp4725.c                     | 29 +++---------
 drivers/iio/dac/ti-dac082s085.c               |  5 +--
 drivers/iio/dac/ti-dac5571.c                  |  7 +--
 drivers/iio/health/max30102.c                 | 11 +++--
 drivers/iio/humidity/hdc100x.c                |  3 +-
 drivers/iio/humidity/htu21.c                  |  3 +-
 drivers/iio/humidity/si7020.c                 |  3 +-
 drivers/iio/magnetometer/ak8974.c             |  3 +-
 drivers/iio/magnetometer/ak8975.c             |  8 ++--
 drivers/iio/potentiometer/ad5272.c            |  5 +--
 drivers/iio/potentiometer/ds1803.c            |  6 +--
 drivers/iio/potentiometer/max5432.c           |  8 ++--
 drivers/iio/potentiometer/max5481.c           | 23 ++--------
 drivers/iio/potentiometer/mcp4018.c           | 12 ++---
 drivers/iio/potentiometer/mcp4131.c           |  8 ++--
 drivers/iio/potentiometer/mcp4531.c           | 11 ++---
 drivers/iio/potentiostat/lmp91000.c           | 11 +++--
 drivers/iio/pressure/icp10100.c               |  3 +-
 drivers/iio/pressure/ms5611_i2c.c             |  6 +--
 drivers/iio/pressure/ms5611_spi.c             |  6 +--
 drivers/iio/pressure/ms5637.c                 |  3 +-
 drivers/iio/pressure/zpa2326_i2c.c            |  6 +--
 drivers/iio/pressure/zpa2326_spi.c            |  6 +--
 drivers/iio/proximity/as3935.c                | 44 +++++++++----------
 .../iio/proximity/pulsedlight-lidar-lite-v2.c |  3 +-
 drivers/iio/resolver/ad2s1200.c               |  3 +-
 drivers/iio/temperature/tmp007.c              |  4 +-
 drivers/iio/temperature/tsys01.c              |  3 +-
 36 files changed, 134 insertions(+), 190 deletions(-)

-- 
2.28.0


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

* [PATCH 01/38] iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 02/38] iio:potentiometer:ds1803: " Jonathan Cameron
                   ` (37 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Phil Reid

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Drop them to remove this restriction.

Also added mod_devicetable.h include given use of struct of_device_id
which is defined in that header.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Phil Reid <preid@eletromag.com.au>
---
 drivers/iio/potentiometer/ad5272.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/potentiometer/ad5272.c b/drivers/iio/potentiometer/ad5272.c
index 933afcf7e925..70c45d346df0 100644
--- a/drivers/iio/potentiometer/ad5272.c
+++ b/drivers/iio/potentiometer/ad5272.c
@@ -15,6 +15,7 @@
 #include <linux/i2c.h>
 #include <linux/iio/iio.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 
 #define  AD5272_RDAC_WR  1
 #define  AD5272_RDAC_RD  2
@@ -192,7 +193,6 @@ static int ad5272_probe(struct i2c_client *client,
 	return devm_iio_device_register(dev, indio_dev);
 }
 
-#if defined(CONFIG_OF)
 static const struct of_device_id ad5272_dt_ids[] = {
 	{ .compatible = "adi,ad5272-020", .data = (void *)AD5272_020 },
 	{ .compatible = "adi,ad5272-050", .data = (void *)AD5272_050 },
@@ -202,7 +202,6 @@ static const struct of_device_id ad5272_dt_ids[] = {
 	{}
 };
 MODULE_DEVICE_TABLE(of, ad5272_dt_ids);
-#endif /* CONFIG_OF */
 
 static const struct i2c_device_id ad5272_id[] = {
 	{ "ad5272-020", AD5272_020 },
@@ -217,7 +216,7 @@ MODULE_DEVICE_TABLE(i2c, ad5272_id);
 static struct i2c_driver ad5272_driver = {
 	.driver = {
 		.name	= "ad5272",
-		.of_match_table = of_match_ptr(ad5272_dt_ids),
+		.of_match_table = ad5272_dt_ids,
 	},
 	.probe		= ad5272_probe,
 	.id_table	= ad5272_id,
-- 
2.28.0


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

* [PATCH 02/38] iio:potentiometer:ds1803: Drop of_match_ptr and CONFIG_OF protections
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 01/38] iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
                   ` (36 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Slawomir Stepien

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Drop them to remove this restriction.

Also switch of.h for mod_devicetable.h include given use of
struct of_device_id which is defined in that header.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Slawomir Stepien <sst@poczta.fm>
---
 drivers/iio/potentiometer/ds1803.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c
index 5c061ab8f46c..20b45407eaac 100644
--- a/drivers/iio/potentiometer/ds1803.c
+++ b/drivers/iio/potentiometer/ds1803.c
@@ -14,7 +14,7 @@
 #include <linux/i2c.h>
 #include <linux/iio/iio.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 
 #define DS1803_MAX_POS		255
 #define DS1803_WRITE(chan)	(0xa8 | ((chan) + 1))
@@ -134,7 +134,6 @@ static int ds1803_probe(struct i2c_client *client,
 	return devm_iio_device_register(dev, indio_dev);
 }
 
-#if defined(CONFIG_OF)
 static const struct of_device_id ds1803_dt_ids[] = {
 	{ .compatible = "maxim,ds1803-010", .data = &ds1803_cfg[DS1803_010] },
 	{ .compatible = "maxim,ds1803-050", .data = &ds1803_cfg[DS1803_050] },
@@ -142,7 +141,6 @@ static const struct of_device_id ds1803_dt_ids[] = {
 	{}
 };
 MODULE_DEVICE_TABLE(of, ds1803_dt_ids);
-#endif /* CONFIG_OF */
 
 static const struct i2c_device_id ds1803_id[] = {
 	{ "ds1803-010", DS1803_010 },
@@ -155,7 +153,7 @@ MODULE_DEVICE_TABLE(i2c, ds1803_id);
 static struct i2c_driver ds1803_driver = {
 	.driver = {
 		.name	= "ds1803",
-		.of_match_table = of_match_ptr(ds1803_dt_ids),
+		.of_match_table = ds1803_dt_ids,
 	},
 	.probe		= ds1803_probe,
 	.id_table	= ds1803_id,
-- 
2.28.0


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

* [PATCH 03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 01/38] iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 02/38] iio:potentiometer:ds1803: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-21 14:24   ` Martin Kaiser
  2020-09-10 17:32 ` [PATCH 04/38] iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
                   ` (35 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Martin Kaiser

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Drop them to remove this restriction.

Also switch headers to reflect this change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Martin Kaiser <martin@kaiser.cx>
---
 drivers/iio/potentiometer/max5432.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/potentiometer/max5432.c b/drivers/iio/potentiometer/max5432.c
index 280de9c54471..aed3b6ab82a2 100644
--- a/drivers/iio/potentiometer/max5432.c
+++ b/drivers/iio/potentiometer/max5432.c
@@ -11,8 +11,8 @@
 #include <linux/iio/iio.h>
 #include <linux/limits.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 /* All chip variants have 32 wiper positions. */
 #define MAX5432_MAX_POS 31
@@ -100,7 +100,7 @@ static int max5432_probe(struct i2c_client *client,
 
 	data = iio_priv(indio_dev);
 	data->client = client;
-	data->ohm = (unsigned long)of_device_get_match_data(dev);
+	data->ohm = (unsigned long)device_get_match_data(dev);
 
 	indio_dev->info = &max5432_info;
 	indio_dev->channels = max5432_channels;
@@ -122,7 +122,7 @@ MODULE_DEVICE_TABLE(of, max5432_dt_ids);
 static struct i2c_driver max5432_driver = {
 	.driver = {
 		.name = "max5432",
-		.of_match_table = of_match_ptr(max5432_dt_ids),
+		.of_match_table = max5432_dt_ids,
 	},
 	.probe = max5432_probe,
 };
-- 
2.28.0


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

* [PATCH 04/38] iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF protections.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (2 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 05/38] iio:potentiometer:max5481: Drop invalid ACPI binding Jonathan Cameron
                   ` (34 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Maury Anderson, Matthew Weber,
	Slawomir Stepien

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Whilst this driver has an ACPI binding, it is not of a form
that is valid under ACPI so will be dropped shortly.

Also switch to device_get_match_data() and switch headers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Maury Anderson <maury.anderson@rockwellcollins.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Slawomir Stepien <sst@poczta.fm>
---
 drivers/iio/potentiometer/max5481.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c
index 5f5988189796..6d1e1a57cba1 100644
--- a/drivers/iio/potentiometer/max5481.c
+++ b/drivers/iio/potentiometer/max5481.c
@@ -11,8 +11,8 @@
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 #include <linux/spi/spi.h>
 
 /* write wiper reg */
@@ -117,7 +117,6 @@ static const struct iio_info max5481_info = {
 	.write_raw = max5481_write_raw,
 };
 
-#if defined(CONFIG_OF)
 static const struct of_device_id max5481_match[] = {
 	{ .compatible = "maxim,max5481", .data = &max5481_cfg[max5481] },
 	{ .compatible = "maxim,max5482", .data = &max5481_cfg[max5482] },
@@ -126,7 +125,6 @@ static const struct of_device_id max5481_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(of, max5481_match);
-#endif
 
 static int max5481_probe(struct spi_device *spi)
 {
@@ -144,7 +142,7 @@ static int max5481_probe(struct spi_device *spi)
 
 	data->spi = spi;
 
-	data->cfg = of_device_get_match_data(&spi->dev);
+	data->cfg = device_get_match_data(&spi->dev);
 	if (!data->cfg)
 		data->cfg = &max5481_cfg[id->driver_data];
 
@@ -198,7 +196,7 @@ MODULE_DEVICE_TABLE(acpi, max5481_acpi_match);
 static struct spi_driver max5481_driver = {
 	.driver = {
 		.name  = "max5481",
-		.of_match_table = of_match_ptr(max5481_match),
+		.of_match_table = max5481_match,
 		.acpi_match_table = ACPI_PTR(max5481_acpi_match),
 	},
 	.probe = max5481_probe,
-- 
2.28.0


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

* [PATCH 05/38] iio:potentiometer:max5481: Drop invalid ACPI binding.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (3 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 04/38] iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-14  8:07   ` Andy Shevchenko
  2020-09-10 17:32 ` [PATCH 06/38] iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
                   ` (33 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Maury Anderson, Matthew Weber,
	Slawomir Stepien

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Given that an ACPI binding must start with 3 or 4 capitals,
this cannot represent a valid binding.

It seems unlikely anything out there is using it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Maury Anderson <maury.anderson@rockwellcollins.com>
Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
Cc: Slawomir Stepien <sst@poczta.fm>
---
 drivers/iio/potentiometer/max5481.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c
index 6d1e1a57cba1..a88ed0eb3adc 100644
--- a/drivers/iio/potentiometer/max5481.c
+++ b/drivers/iio/potentiometer/max5481.c
@@ -7,7 +7,6 @@
  * https://datasheets.maximintegrated.com/en/ds/MAX5481-MAX5484.pdf
  */
 
-#include <linux/acpi.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/module.h>
@@ -182,22 +181,10 @@ static const struct spi_device_id max5481_id_table[] = {
 };
 MODULE_DEVICE_TABLE(spi, max5481_id_table);
 
-#if defined(CONFIG_ACPI)
-static const struct acpi_device_id max5481_acpi_match[] = {
-	{ "max5481", max5481 },
-	{ "max5482", max5482 },
-	{ "max5483", max5483 },
-	{ "max5484", max5484 },
-	{ }
-};
-MODULE_DEVICE_TABLE(acpi, max5481_acpi_match);
-#endif
-
 static struct spi_driver max5481_driver = {
 	.driver = {
 		.name  = "max5481",
 		.of_match_table = max5481_match,
-		.acpi_match_table = ACPI_PTR(max5481_acpi_match),
 	},
 	.probe = max5481_probe,
 	.remove = max5481_remove,
-- 
2.28.0


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

* [PATCH 06/38] iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (4 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 05/38] iio:potentiometer:max5481: Drop invalid ACPI binding Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 07/38] iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces Jonathan Cameron
                   ` (32 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Peter Rosin

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Also use device_get_match_data() rather than devicetree only version.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Peter Rosin <peda@axentia.se>
---
 drivers/iio/potentiometer/mcp4018.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/potentiometer/mcp4018.c b/drivers/iio/potentiometer/mcp4018.c
index fd0579ad3c83..c0e171fec062 100644
--- a/drivers/iio/potentiometer/mcp4018.c
+++ b/drivers/iio/potentiometer/mcp4018.c
@@ -16,8 +16,8 @@
 #include <linux/i2c.h>
 #include <linux/iio/iio.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 #define MCP4018_WIPER_MAX 127
 
@@ -116,8 +116,6 @@ static const struct i2c_device_id mcp4018_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, mcp4018_id);
 
-#ifdef CONFIG_OF
-
 #define MCP4018_COMPATIBLE(of_compatible, cfg) {	\
 	.compatible = of_compatible,			\
 	.data = &mcp4018_cfg[cfg],			\
@@ -140,8 +138,6 @@ static const struct of_device_id mcp4018_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, mcp4018_of_match);
 
-#endif
-
 static int mcp4018_probe(struct i2c_client *client)
 {
 	struct device *dev = &client->dev;
@@ -161,7 +157,7 @@ static int mcp4018_probe(struct i2c_client *client)
 	i2c_set_clientdata(client, indio_dev);
 	data->client = client;
 
-	data->cfg = of_device_get_match_data(dev);
+	data->cfg = device_get_match_data(dev);
 	if (!data->cfg)
 		data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)->driver_data];
 
@@ -176,7 +172,7 @@ static int mcp4018_probe(struct i2c_client *client)
 static struct i2c_driver mcp4018_driver = {
 	.driver = {
 		.name	= "mcp4018",
-		.of_match_table = of_match_ptr(mcp4018_of_match),
+		.of_match_table = mcp4018_of_match,
 	},
 	.probe_new	= mcp4018_probe,
 	.id_table	= mcp4018_id,
-- 
2.28.0


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

* [PATCH 07/38] iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (5 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 06/38] iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 08/38] iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
                   ` (31 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Slawomir Stepien

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This change allows the use of the driver with ACPI via PRP0001
and remove an example of an anti pattern I'm trying to remove from IIO.
Also adjust includes to reflect this change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Slawomir Stepien <sst@poczta.fm>
---
 drivers/iio/potentiometer/mcp4131.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/potentiometer/mcp4131.c b/drivers/iio/potentiometer/mcp4131.c
index 2923ce250fc3..7c8c18ab8764 100644
--- a/drivers/iio/potentiometer/mcp4131.c
+++ b/drivers/iio/potentiometer/mcp4131.c
@@ -37,9 +37,9 @@
 #include <linux/iio/iio.h>
 #include <linux/iio/types.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/property.h>
 #include <linux/spi/spi.h>
 
 #define MCP4131_WRITE		(0x00 << 2)
@@ -252,7 +252,7 @@ static int mcp4131_probe(struct spi_device *spi)
 	data = iio_priv(indio_dev);
 	spi_set_drvdata(spi, indio_dev);
 	data->spi = spi;
-	data->cfg = of_device_get_match_data(&spi->dev);
+	data->cfg = device_get_match_data(&spi->dev);
 	if (!data->cfg) {
 		devid = spi_get_device_id(spi)->driver_data;
 		data->cfg = &mcp4131_cfg[devid];
@@ -479,7 +479,7 @@ MODULE_DEVICE_TABLE(spi, mcp4131_id);
 static struct spi_driver mcp4131_driver = {
 	.driver = {
 		.name	= "mcp4131",
-		.of_match_table = of_match_ptr(mcp4131_dt_ids),
+		.of_match_table = mcp4131_dt_ids,
 	},
 	.probe		= mcp4131_probe,
 	.id_table	= mcp4131_id,
-- 
2.28.0


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

* [PATCH 08/38] iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF protections.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (6 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 07/38] iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 09/38] iio:dac:ad5446: " Jonathan Cameron
                   ` (30 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Peter Rosin

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Hence drop them from this driver.

Also switch to device_get_match_data() from of_ variant and adjust
headers to reflect the change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Peter Rosin <peda@axentia.se>
---
 drivers/iio/potentiometer/mcp4531.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c
index 95efc4b40514..c25f84b4a270 100644
--- a/drivers/iio/potentiometer/mcp4531.c
+++ b/drivers/iio/potentiometer/mcp4531.c
@@ -28,8 +28,8 @@
 #include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/err.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 #include <linux/iio/iio.h>
 
@@ -275,8 +275,6 @@ static const struct i2c_device_id mcp4531_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, mcp4531_id);
 
-#ifdef CONFIG_OF
-
 #define MCP4531_COMPATIBLE(of_compatible, cfg) {	\
 			.compatible = of_compatible,	\
 			.data = &mcp4531_cfg[cfg],	\
@@ -350,7 +348,6 @@ static const struct of_device_id mcp4531_of_match[] = {
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mcp4531_of_match);
-#endif
 
 static int mcp4531_probe(struct i2c_client *client)
 {
@@ -371,7 +368,7 @@ static int mcp4531_probe(struct i2c_client *client)
 	i2c_set_clientdata(client, indio_dev);
 	data->client = client;
 
-	data->cfg = of_device_get_match_data(dev);
+	data->cfg = device_get_match_data(dev);
 	if (!data->cfg)
 		data->cfg = &mcp4531_cfg[i2c_match_id(mcp4531_id, client)->driver_data];
 
@@ -386,7 +383,7 @@ static int mcp4531_probe(struct i2c_client *client)
 static struct i2c_driver mcp4531_driver = {
 	.driver = {
 		.name	= "mcp4531",
-		.of_match_table = of_match_ptr(mcp4531_of_match),
+		.of_match_table = mcp4531_of_match,
 	},
 	.probe_new	= mcp4531_probe,
 	.id_table	= mcp4531_id,
-- 
2.28.0


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

* [PATCH 09/38] iio:dac:ad5446: Drop of_match_ptr and CONFIG_OF protections
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (7 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 08/38] iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 10/38] iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections Jonathan Cameron
                   ` (29 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Michael Hennerich

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Hence drop them from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/iio/dac/ad5446.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
index 935a6177569f..d87e21016863 100644
--- a/drivers/iio/dac/ad5446.c
+++ b/drivers/iio/dac/ad5446.c
@@ -17,6 +17,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/err.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -478,13 +479,11 @@ static const struct spi_device_id ad5446_spi_ids[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad5446_spi_ids);
 
-#ifdef CONFIG_OF
 static const struct of_device_id ad5446_of_ids[] = {
 	{ .compatible = "ti,dac7512" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ad5446_of_ids);
-#endif
 
 static int ad5446_spi_probe(struct spi_device *spi)
 {
@@ -502,7 +501,7 @@ static int ad5446_spi_remove(struct spi_device *spi)
 static struct spi_driver ad5446_spi_driver = {
 	.driver = {
 		.name	= "ad5446",
-		.of_match_table = of_match_ptr(ad5446_of_ids),
+		.of_match_table = ad5446_of_ids,
 	},
 	.probe		= ad5446_spi_probe,
 	.remove		= ad5446_spi_remove,
-- 
2.28.0


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

* [PATCH 10/38] iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (8 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 09/38] iio:dac:ad5446: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 11/38] iio:dac:ad5593r: " Jonathan Cameron
                   ` (28 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Michael Hennerich, Lars-Peter Clausen

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These result in a very small reduction in driver size, but at the
cost of more complex build and slightly harder to read code.
In the case of of_match_ptr it also prevents use of PRP0001
ACPI based identification.  In this particular case we have
a valid ACPI/PNP ID that I am assuming was issued by Analog
Devices.  That should be used in preference to PRP0001 but doesn't
mean we should prevent that route.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/dac/ad5592r.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/dac/ad5592r.c b/drivers/iio/dac/ad5592r.c
index 49308ad13c4b..41f651500668 100644
--- a/drivers/iio/dac/ad5592r.c
+++ b/drivers/iio/dac/ad5592r.c
@@ -10,9 +10,8 @@
 
 #include <linux/bitops.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
-#include <linux/acpi.h>
 
 #define AD5592R_GPIO_READBACK_EN	BIT(10)
 #define AD5592R_LDAC_READBACK_EN	BIT(6)
@@ -157,8 +156,8 @@ MODULE_DEVICE_TABLE(acpi, ad5592r_acpi_match);
 static struct spi_driver ad5592r_spi_driver = {
 	.driver = {
 		.name = "ad5592r",
-		.of_match_table = of_match_ptr(ad5592r_of_match),
-		.acpi_match_table = ACPI_PTR(ad5592r_acpi_match),
+		.of_match_table = ad5592r_of_match,
+		.acpi_match_table = ad5592r_acpi_match,
 	},
 	.probe = ad5592r_spi_probe,
 	.remove = ad5592r_spi_remove,
-- 
2.28.0


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

* [PATCH 11/38] iio:dac:ad5593r: Drop of_match_ptr and ACPI_PTR protections.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (9 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 10/38] iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 12/38] iio:dac:ad7303: Drop of_match_ptr protection Jonathan Cameron
                   ` (27 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Michael Hennerich, Lars-Peter Clausen

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These result in a very small reduction in driver size, but at the
cost of more complex build and slightly harder to read code.
In the case of of_match_ptr it also prevents use of PRP0001
ACPI based identification.  In this particular case we have
a valid ACPI/PNP ID that I am assuming was issued by Analog
Devices.  That should be used in preference to PRP0001 but doesn't
mean we should prevent that route.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/dac/ad5593r.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/dac/ad5593r.c b/drivers/iio/dac/ad5593r.c
index 1fbe9c019c7f..5b4df36fdc2a 100644
--- a/drivers/iio/dac/ad5593r.c
+++ b/drivers/iio/dac/ad5593r.c
@@ -11,8 +11,7 @@
 #include <linux/bitops.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/acpi.h>
+#include <linux/mod_devicetable.h>
 
 #define AD5593R_MODE_CONF		(0 << 4)
 #define AD5593R_MODE_DAC_WRITE		(1 << 4)
@@ -124,8 +123,8 @@ MODULE_DEVICE_TABLE(acpi, ad5593r_acpi_match);
 static struct i2c_driver ad5593r_driver = {
 	.driver = {
 		.name = "ad5593r",
-		.of_match_table = of_match_ptr(ad5593r_of_match),
-		.acpi_match_table = ACPI_PTR(ad5593r_acpi_match),
+		.of_match_table = ad5593r_of_match,
+		.acpi_match_table = ad5593r_acpi_match,
 	},
 	.probe = ad5593r_i2c_probe,
 	.remove = ad5593r_i2c_remove,
-- 
2.28.0


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

* [PATCH 12/38] iio:dac:ad7303: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (10 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 11/38] iio:dac:ad5593r: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 13/38] iio:dac:mcp4725: drop of_match_ptr and use generic fw properties Jonathan Cameron
                   ` (26 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio
  Cc: Andy Shevchenko, Jonathan Cameron, Michael Hennerich, Lars-Peter Clausen

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.

Also add mod_devicetable.h include given struct of_device_id is
declared there.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/dac/ad7303.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad7303.c b/drivers/iio/dac/ad7303.c
index 4460aa57a33f..20c85c2a636c 100644
--- a/drivers/iio/dac/ad7303.c
+++ b/drivers/iio/dac/ad7303.c
@@ -7,6 +7,7 @@
 
 #include <linux/err.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/kernel.h>
 #include <linux/spi/spi.h>
 #include <linux/slab.h>
@@ -287,7 +288,7 @@ MODULE_DEVICE_TABLE(spi, ad7303_spi_ids);
 static struct spi_driver ad7303_driver = {
 	.driver = {
 		.name = "ad7303",
-		.of_match_table = of_match_ptr(ad7303_spi_of_match),
+		.of_match_table = ad7303_spi_of_match,
 	},
 	.probe = ad7303_probe,
 	.remove = ad7303_remove,
-- 
2.28.0


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

* [PATCH 13/38] iio:dac:mcp4725: drop of_match_ptr and use generic fw properties
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (11 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 12/38] iio:dac:ad7303: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 14/38] iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
                   ` (25 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Peter Meerwald

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This enables use of ACPI PRP0001 and removes an antipattern I am
trying to stop people copying in IIO.

This particular case is more complex than most because it allowed
probing via sysfs with out a fwnode but would presumably always
have then failed.   Now the code will assume that properties are
the defaults if not specified or the firmware node is not present.
This relaxation of the constraints should not break any existing
cases and may enable some new ones.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
---
 drivers/iio/dac/mcp4725.c | 29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index ee174d224110..beb9a15b7c74 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -16,8 +16,8 @@
 #include <linux/err.h>
 #include <linux/delay.h>
 #include <linux/regulator/consumer.h>
-#include <linux/of_device.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -357,29 +357,16 @@ static const struct iio_info mcp4725_info = {
 	.attrs = &mcp4725_attribute_group,
 };
 
-#ifdef CONFIG_OF
 static int mcp4725_probe_dt(struct device *dev,
 			    struct mcp4725_platform_data *pdata)
 {
-	struct device_node *np = dev->of_node;
-
-	if (!np)
-		return -ENODEV;
-
 	/* check if is the vref-supply defined */
-	pdata->use_vref = of_property_read_bool(np, "vref-supply");
+	pdata->use_vref = device_property_read_bool(dev, "vref-supply");
 	pdata->vref_buffered =
-		of_property_read_bool(np, "microchip,vref-buffered");
+		device_property_read_bool(dev, "microchip,vref-buffered");
 
 	return 0;
 }
-#else
-static int mcp4725_probe_dt(struct device *dev,
-			    struct mcp4725_platform_data *platform_data)
-{
-	return -ENODEV;
-}
-#endif
 
 static int mcp4725_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
@@ -398,8 +385,8 @@ static int mcp4725_probe(struct i2c_client *client,
 	data = iio_priv(indio_dev);
 	i2c_set_clientdata(client, indio_dev);
 	data->client = client;
-	if (client->dev.of_node)
-		data->id = (enum chip_id)of_device_get_match_data(&client->dev);
+	if (dev_fwnode(&client->dev))
+		data->id = (enum chip_id)device_get_match_data(&client->dev);
 	else
 		data->id = id->driver_data;
 	pdata = dev_get_platdata(&client->dev);
@@ -519,7 +506,6 @@ static const struct i2c_device_id mcp4725_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, mcp4725_id);
 
-#ifdef CONFIG_OF
 static const struct of_device_id mcp4725_of_match[] = {
 	{
 		.compatible = "microchip,mcp4725",
@@ -532,12 +518,11 @@ static const struct of_device_id mcp4725_of_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mcp4725_of_match);
-#endif
 
 static struct i2c_driver mcp4725_driver = {
 	.driver = {
 		.name	= MCP4725_DRV_NAME,
-		.of_match_table = of_match_ptr(mcp4725_of_match),
+		.of_match_table = mcp4725_of_match,
 		.pm	= &mcp4725_pm_ops,
 	},
 	.probe		= mcp4725_probe,
-- 
2.28.0


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

* [PATCH 14/38] iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (12 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 13/38] iio:dac:mcp4725: drop of_match_ptr and use generic fw properties Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 15/38] iio:dac:ti-dac5571: " Jonathan Cameron
                   ` (24 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Lukas Wunner

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent the use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Hence drop them from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lukas Wunner <lukas@wunner.de>
---
 drivers/iio/dac/ti-dac082s085.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/dac/ti-dac082s085.c b/drivers/iio/dac/ti-dac082s085.c
index 86bfb1c3f9b9..de33c1fc6e0b 100644
--- a/drivers/iio/dac/ti-dac082s085.c
+++ b/drivers/iio/dac/ti-dac082s085.c
@@ -14,6 +14,7 @@
 
 #include <linux/iio/iio.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
 
@@ -324,7 +325,6 @@ static int ti_dac_remove(struct spi_device *spi)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id ti_dac_of_id[] = {
 	{ .compatible = "ti,dac082s085" },
 	{ .compatible = "ti,dac102s085" },
@@ -335,7 +335,6 @@ static const struct of_device_id ti_dac_of_id[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ti_dac_of_id);
-#endif
 
 static const struct spi_device_id ti_dac_spi_id[] = {
 	{ "dac082s085", dual_8bit  },
@@ -351,7 +350,7 @@ MODULE_DEVICE_TABLE(spi, ti_dac_spi_id);
 static struct spi_driver ti_dac_driver = {
 	.driver = {
 		.name		= "ti-dac082s085",
-		.of_match_table	= of_match_ptr(ti_dac_of_id),
+		.of_match_table	= ti_dac_of_id,
 	},
 	.probe	  = ti_dac_probe,
 	.remove   = ti_dac_remove,
-- 
2.28.0


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

* [PATCH 15/38] iio:dac:ti-dac5571: Drop of_match_ptr and CONFIG_OF protections
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (13 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 14/38] iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 16/38] iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
                   ` (23 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Sean Nyekjaer

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent the use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Hence drop them from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
---
 drivers/iio/dac/ti-dac5571.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c
index d303b19814e7..d3295767a079 100644
--- a/drivers/iio/dac/ti-dac5571.c
+++ b/drivers/iio/dac/ti-dac5571.c
@@ -18,8 +18,7 @@
 #include <linux/iio/iio.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regulator/consumer.h>
 
 enum chip_id {
@@ -384,7 +383,6 @@ static int dac5571_remove(struct i2c_client *i2c)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id dac5571_of_id[] = {
 	{.compatible = "ti,dac5571"},
 	{.compatible = "ti,dac6571"},
@@ -398,7 +396,6 @@ static const struct of_device_id dac5571_of_id[] = {
 	{}
 };
 MODULE_DEVICE_TABLE(of, dac5571_of_id);
-#endif
 
 static const struct i2c_device_id dac5571_id[] = {
 	{"dac5571", single_8bit},
@@ -417,7 +414,7 @@ MODULE_DEVICE_TABLE(i2c, dac5571_id);
 static struct i2c_driver dac5571_driver = {
 	.driver = {
 		   .name = "ti-dac5571",
-		   .of_match_table = of_match_ptr(dac5571_of_id),
+		   .of_match_table = dac5571_of_id,
 	},
 	.probe	  = dac5571_probe,
 	.remove   = dac5571_remove,
-- 
2.28.0


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

* [PATCH 16/38] iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (14 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 15/38] iio:dac:ti-dac5571: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:59   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 17/38] iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
                   ` (22 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This change allows use of this driver with ACPI via PRP0001 and removes
an example of an anti pattern I'm trying to remove from IIO.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/potentiostat/lmp91000.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
index 67ae635a05f3..f34ca769dc20 100644
--- a/drivers/iio/potentiostat/lmp91000.c
+++ b/drivers/iio/potentiostat/lmp91000.c
@@ -11,7 +11,7 @@
 #include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/delay.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regmap.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
@@ -205,13 +205,12 @@ static const struct iio_info lmp91000_info = {
 static int lmp91000_read_config(struct lmp91000_data *data)
 {
 	struct device *dev = data->dev;
-	struct device_node *np = dev->of_node;
 	unsigned int reg, val;
 	int i, ret;
 
-	ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
+	ret = device_property_read_u32(dev, "ti,tia-gain-ohm", &val);
 	if (ret) {
-		if (!of_property_read_bool(np, "ti,external-tia-resistor")) {
+		if (!device_property_read_bool(dev, "ti,external-tia-resistor")) {
 			dev_err(dev, "no ti,tia-gain-ohm defined and external resistor not specified\n");
 			return ret;
 		}
@@ -232,7 +231,7 @@ static int lmp91000_read_config(struct lmp91000_data *data)
 		return ret;
 	}
 
-	ret = of_property_read_u32(np, "ti,rload-ohm", &val);
+	ret = device_property_read_u32(dev, "ti,rload-ohm", &val);
 	if (ret) {
 		val = 100;
 		dev_info(dev, "no ti,rload-ohm defined, default to %d\n", val);
@@ -422,7 +421,7 @@ MODULE_DEVICE_TABLE(i2c, lmp91000_id);
 static struct i2c_driver lmp91000_driver = {
 	.driver = {
 		.name = LMP91000_DRV_NAME,
-		.of_match_table = of_match_ptr(lmp91000_of_match),
+		.of_match_table = lmp91000_of_match,
 	},
 	.probe = lmp91000_probe,
 	.remove = lmp91000_remove,
-- 
2.28.0


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

* [PATCH 17/38] iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (15 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 16/38] iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 18/38] iio:pressure:ms5611: " Jonathan Cameron
                   ` (21 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Jean-Baptiste Maneyrol

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevents use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Hence drop them from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
 drivers/iio/pressure/icp10100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/pressure/icp10100.c b/drivers/iio/pressure/icp10100.c
index 90c0df068bbb..48759fc4bf18 100644
--- a/drivers/iio/pressure/icp10100.c
+++ b/drivers/iio/pressure/icp10100.c
@@ -10,6 +10,7 @@
 
 #include <linux/device.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/i2c.h>
 #include <linux/pm_runtime.h>
 #include <linux/crc8.h>
@@ -645,7 +646,7 @@ static struct i2c_driver icp10100_driver = {
 	.driver = {
 		.name = "icp10100",
 		.pm = &icp10100_pm,
-		.of_match_table = of_match_ptr(icp10100_of_match),
+		.of_match_table = icp10100_of_match,
 	},
 	.probe = icp10100_probe,
 	.id_table = icp10100_id,
-- 
2.28.0


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

* [PATCH 18/38] iio:pressure:ms5611: Drop of_match_ptr and CONFIG_OF protections
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (16 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 17/38] iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 19/38] iio:pressure:ms5637: Drop of_match_ptr protection Jonathan Cameron
                   ` (20 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Tomasz Duszynski

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevents use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Hence drop them from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomasz Duszynski <tduszyns@gmail.com>
---
 drivers/iio/pressure/ms5611_i2c.c | 6 ++----
 drivers/iio/pressure/ms5611_spi.c | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/pressure/ms5611_i2c.c b/drivers/iio/pressure/ms5611_i2c.c
index 072c106dd66d..7c04f730430c 100644
--- a/drivers/iio/pressure/ms5611_i2c.c
+++ b/drivers/iio/pressure/ms5611_i2c.c
@@ -14,7 +14,7 @@
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 
 #include <asm/unaligned.h>
 
@@ -113,14 +113,12 @@ static int ms5611_i2c_remove(struct i2c_client *client)
 	return ms5611_remove(i2c_get_clientdata(client));
 }
 
-#if defined(CONFIG_OF)
 static const struct of_device_id ms5611_i2c_matches[] = {
 	{ .compatible = "meas,ms5611" },
 	{ .compatible = "meas,ms5607" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ms5611_i2c_matches);
-#endif
 
 static const struct i2c_device_id ms5611_id[] = {
 	{ "ms5611", MS5611 },
@@ -132,7 +130,7 @@ MODULE_DEVICE_TABLE(i2c, ms5611_id);
 static struct i2c_driver ms5611_driver = {
 	.driver = {
 		.name = "ms5611",
-		.of_match_table = of_match_ptr(ms5611_i2c_matches)
+		.of_match_table = ms5611_i2c_matches,
 	},
 	.id_table = ms5611_id,
 	.probe = ms5611_i2c_probe,
diff --git a/drivers/iio/pressure/ms5611_spi.c b/drivers/iio/pressure/ms5611_spi.c
index 4799aa57135e..45d3a7d5be8e 100644
--- a/drivers/iio/pressure/ms5611_spi.c
+++ b/drivers/iio/pressure/ms5611_spi.c
@@ -9,7 +9,7 @@
 #include <linux/delay.h>
 #include <linux/module.h>
 #include <linux/spi/spi.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 
 #include <asm/unaligned.h>
 
@@ -115,14 +115,12 @@ static int ms5611_spi_remove(struct spi_device *spi)
 	return ms5611_remove(spi_get_drvdata(spi));
 }
 
-#if defined(CONFIG_OF)
 static const struct of_device_id ms5611_spi_matches[] = {
 	{ .compatible = "meas,ms5611" },
 	{ .compatible = "meas,ms5607" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ms5611_spi_matches);
-#endif
 
 static const struct spi_device_id ms5611_id[] = {
 	{ "ms5611", MS5611 },
@@ -134,7 +132,7 @@ MODULE_DEVICE_TABLE(spi, ms5611_id);
 static struct spi_driver ms5611_driver = {
 	.driver = {
 		.name = "ms5611",
-		.of_match_table = of_match_ptr(ms5611_spi_matches)
+		.of_match_table = ms5611_spi_matches
 	},
 	.id_table = ms5611_id,
 	.probe = ms5611_spi_probe,
-- 
2.28.0


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

* [PATCH 19/38] iio:pressure:ms5637: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (17 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 18/38] iio:pressure:ms5611: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 20/38] iio:pressure:zpa2326: " Jonathan Cameron
                   ` (19 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Ludovic Tancerel

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
---
 drivers/iio/pressure/ms5637.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/pressure/ms5637.c b/drivers/iio/pressure/ms5637.c
index 05e0ef7260d5..5b59a4137d32 100644
--- a/drivers/iio/pressure/ms5637.c
+++ b/drivers/iio/pressure/ms5637.c
@@ -22,6 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/stat.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/i2c.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -192,7 +193,7 @@ static struct i2c_driver ms5637_driver = {
 	.id_table = ms5637_id,
 	.driver = {
 		   .name = "ms5637",
-		   .of_match_table = of_match_ptr(ms5637_of_match),
+		   .of_match_table = ms5637_of_match,
 		   },
 };
 
-- 
2.28.0


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

* [PATCH 20/38] iio:pressure:zpa2326: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (18 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 19/38] iio:pressure:ms5637: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 21/38] iio:temperature:tsys01: " Jonathan Cameron
                   ` (18 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Gregor Boirie

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Gregor Boirie <gregor.boirie@parrot.com>
---
 drivers/iio/pressure/zpa2326_i2c.c | 6 ++----
 drivers/iio/pressure/zpa2326_spi.c | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/pressure/zpa2326_i2c.c b/drivers/iio/pressure/zpa2326_i2c.c
index 1a65791ba279..95d9739444c4 100644
--- a/drivers/iio/pressure/zpa2326_i2c.c
+++ b/drivers/iio/pressure/zpa2326_i2c.c
@@ -10,7 +10,7 @@
 #include <linux/module.h>
 #include <linux/regmap.h>
 #include <linux/i2c.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include "zpa2326.h"
 
 /*
@@ -66,18 +66,16 @@ static const struct i2c_device_id zpa2326_i2c_ids[] = {
 };
 MODULE_DEVICE_TABLE(i2c, zpa2326_i2c_ids);
 
-#if defined(CONFIG_OF)
 static const struct of_device_id zpa2326_i2c_matches[] = {
 	{ .compatible = "murata,zpa2326" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, zpa2326_i2c_matches);
-#endif
 
 static struct i2c_driver zpa2326_i2c_driver = {
 	.driver = {
 		.name           = "zpa2326-i2c",
-		.of_match_table = of_match_ptr(zpa2326_i2c_matches),
+		.of_match_table = zpa2326_i2c_matches,
 		.pm             = ZPA2326_PM_OPS,
 	},
 	.probe    = zpa2326_probe_i2c,
diff --git a/drivers/iio/pressure/zpa2326_spi.c b/drivers/iio/pressure/zpa2326_spi.c
index f37a4c738c75..85201a4bae44 100644
--- a/drivers/iio/pressure/zpa2326_spi.c
+++ b/drivers/iio/pressure/zpa2326_spi.c
@@ -10,7 +10,7 @@
 #include <linux/module.h>
 #include <linux/regmap.h>
 #include <linux/spi/spi.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include "zpa2326.h"
 
 /*
@@ -70,18 +70,16 @@ static const struct spi_device_id zpa2326_spi_ids[] = {
 };
 MODULE_DEVICE_TABLE(spi, zpa2326_spi_ids);
 
-#if defined(CONFIG_OF)
 static const struct of_device_id zpa2326_spi_matches[] = {
 	{ .compatible = "murata,zpa2326" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, zpa2326_spi_matches);
-#endif
 
 static struct spi_driver zpa2326_spi_driver = {
 	.driver = {
 		.name           = "zpa2326-spi",
-		.of_match_table = of_match_ptr(zpa2326_spi_matches),
+		.of_match_table = zpa2326_spi_matches,
 		.pm             = ZPA2326_PM_OPS,
 	},
 	.probe    = zpa2326_probe_spi,
-- 
2.28.0


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

* [PATCH 21/38] iio:temperature:tsys01: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (19 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 20/38] iio:pressure:zpa2326: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 22/38] iio:temperature:tmp007: " Jonathan Cameron
                   ` (17 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Ludovic Tancerel

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
---
 drivers/iio/temperature/tsys01.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/temperature/tsys01.c b/drivers/iio/temperature/tsys01.c
index 2c631a1ca33b..bbfbad9a8767 100644
--- a/drivers/iio/temperature/tsys01.c
+++ b/drivers/iio/temperature/tsys01.c
@@ -13,6 +13,7 @@
 #include <linux/device.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
@@ -222,7 +223,7 @@ static struct i2c_driver tsys01_driver = {
 	.id_table = tsys01_id,
 	.driver = {
 		   .name = "tsys01",
-		   .of_match_table = of_match_ptr(tsys01_of_match),
+		   .of_match_table = tsys01_of_match,
 		   },
 };
 
-- 
2.28.0


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

* [PATCH 22/38] iio:temperature:tmp007: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (20 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 21/38] iio:temperature:tsys01: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 23/38] iio:resolver:ad2s1200: " Jonathan Cameron
                   ` (16 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Manivannan Sadhasivam

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Manivannan Sadhasivam <manivannanece23@gmail.com>
---
 drivers/iio/temperature/tmp007.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/temperature/tmp007.c b/drivers/iio/temperature/tmp007.c
index f90fe9e5617b..ad2b35c65548 100644
--- a/drivers/iio/temperature/tmp007.c
+++ b/drivers/iio/temperature/tmp007.c
@@ -20,7 +20,7 @@
 #include <linux/module.h>
 #include <linux/pm.h>
 #include <linux/bitops.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 
@@ -578,7 +578,7 @@ MODULE_DEVICE_TABLE(i2c, tmp007_id);
 static struct i2c_driver tmp007_driver = {
 	.driver = {
 		.name	= "tmp007",
-		.of_match_table = of_match_ptr(tmp007_of_match),
+		.of_match_table = tmp007_of_match,
 		.pm	= &tmp007_pm_ops,
 	},
 	.probe		= tmp007_probe,
-- 
2.28.0


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

* [PATCH 23/38] iio:resolver:ad2s1200: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (21 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 22/38] iio:temperature:tmp007: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 24/38] iio:chemical:ams-iaq-core: " Jonathan Cameron
                   ` (15 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/resolver/ad2s1200.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/resolver/ad2s1200.c b/drivers/iio/resolver/ad2s1200.c
index 6007abad116b..9746bd935628 100644
--- a/drivers/iio/resolver/ad2s1200.c
+++ b/drivers/iio/resolver/ad2s1200.c
@@ -12,6 +12,7 @@
 #include <linux/device.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
 #include <linux/spi/spi.h>
 #include <linux/sysfs.h>
@@ -192,7 +193,7 @@ MODULE_DEVICE_TABLE(spi, ad2s1200_id);
 static struct spi_driver ad2s1200_driver = {
 	.driver = {
 		.name = DRV_NAME,
-		.of_match_table = of_match_ptr(ad2s1200_of_match),
+		.of_match_table = ad2s1200_of_match,
 	},
 	.probe = ad2s1200_probe,
 	.id_table = ad2s1200_id,
-- 
2.28.0


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

* [PATCH 24/38] iio:chemical:ams-iaq-core: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (22 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 23/38] iio:resolver:ad2s1200: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:55   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 25/38] iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
                   ` (14 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/ams-iaq-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/chemical/ams-iaq-core.c b/drivers/iio/chemical/ams-iaq-core.c
index 8c1b64fd424a..97be3669c554 100644
--- a/drivers/iio/chemical/ams-iaq-core.c
+++ b/drivers/iio/chemical/ams-iaq-core.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/i2c.h>
@@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE(of, ams_iaqcore_dt_ids);
 static struct i2c_driver ams_iaqcore_driver = {
 	.driver = {
 		.name	= "ams-iaq-core",
-		.of_match_table = of_match_ptr(ams_iaqcore_dt_ids),
+		.of_match_table = ams_iaqcore_dt_ids,
 	},
 	.probe = ams_iaqcore_probe,
 	.id_table = ams_iaqcore_id,
-- 
2.28.0


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

* [PATCH 25/38] iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (23 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 24/38] iio:chemical:ams-iaq-core: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:59   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 26/38] iio:chemical:sgp30: Use local variable dev to simplify code Jonathan Cameron
                   ` (13 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

of_match_ptr() prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver and use generic fw accessors to check
if there is a fw_node and get the id.

It might be neater to use pointers rather than indexes for
the device_data but that is another issue and should be handled
separately.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/atlas-sensor.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c
index 43069636fcd5..cdab9d04dedd 100644
--- a/drivers/iio/chemical/atlas-sensor.c
+++ b/drivers/iio/chemical/atlas-sensor.c
@@ -15,7 +15,7 @@
 #include <linux/irq.h>
 #include <linux/irq_work.h>
 #include <linux/i2c.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regmap.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
@@ -620,7 +620,6 @@ static int atlas_probe(struct i2c_client *client,
 {
 	struct atlas_data *data;
 	struct atlas_device *chip;
-	const struct of_device_id *of_id;
 	struct iio_trigger *trig;
 	struct iio_dev *indio_dev;
 	int ret;
@@ -629,11 +628,10 @@ static int atlas_probe(struct i2c_client *client,
 	if (!indio_dev)
 		return -ENOMEM;
 
-	of_id = of_match_device(atlas_dt_ids, &client->dev);
-	if (!of_id)
+	if (!dev_fwnode(&client->dev))
 		chip = &atlas_devices[id->driver_data];
 	else
-		chip = &atlas_devices[(unsigned long)of_id->data];
+		chip = &atlas_devices[(unsigned long)device_get_match_data(&client->dev)];
 
 	indio_dev->info = &atlas_info;
 	indio_dev->name = ATLAS_DRV_NAME;
@@ -775,7 +773,7 @@ static const struct dev_pm_ops atlas_pm_ops = {
 static struct i2c_driver atlas_driver = {
 	.driver = {
 		.name	= ATLAS_DRV_NAME,
-		.of_match_table	= of_match_ptr(atlas_dt_ids),
+		.of_match_table	= atlas_dt_ids,
 		.pm	= &atlas_pm_ops,
 	},
 	.probe		= atlas_probe,
-- 
2.28.0


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

* [PATCH 26/38] iio:chemical:sgp30: Use local variable dev to simplify code
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (24 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 25/38] iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 27/38] iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
                   ` (12 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Andreas Brauchli

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This cleans up the code at bit, but is primarily here as a precusor
to the next patch. I've only done this for the two functions
which use the dev pointer repeatedly.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andreas Brauchli <andreas.brauchli@sensirion.com>
---
 drivers/iio/chemical/sgp30.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c
index 2c4086c48136..410565aa20b6 100644
--- a/drivers/iio/chemical/sgp30.c
+++ b/drivers/iio/chemical/sgp30.c
@@ -409,6 +409,7 @@ static int sgp_read_raw(struct iio_dev *indio_dev,
 static int sgp_check_compat(struct sgp_data *data,
 			    unsigned int product_id)
 {
+	struct device *dev = &data->client->dev;
 	const struct sgp_version *supported_versions;
 	u16 ix, num_fs;
 	u16 product, generation, major, minor;
@@ -416,21 +417,20 @@ static int sgp_check_compat(struct sgp_data *data,
 	/* driver does not match product */
 	generation = SGP_VERS_GEN(data);
 	if (generation != 0) {
-		dev_err(&data->client->dev,
+		dev_err(dev,
 			"incompatible product generation %d != 0", generation);
 		return -ENODEV;
 	}
 
 	product = SGP_VERS_PRODUCT(data);
 	if (product != product_id) {
-		dev_err(&data->client->dev,
-			"sensor reports a different product: 0x%04hx\n",
+		dev_err(dev, "sensor reports a different product: 0x%04hx\n",
 			product);
 		return -ENODEV;
 	}
 
 	if (SGP_VERS_RESERVED(data))
-		dev_warn(&data->client->dev, "reserved bit is set\n");
+		dev_warn(dev, "reserved bit is set\n");
 
 	/* engineering samples are not supported: no interface guarantees */
 	if (SGP_VERS_ENG_BIT(data))
@@ -456,8 +456,7 @@ static int sgp_check_compat(struct sgp_data *data,
 		    minor >= supported_versions[ix].minor)
 			return 0;
 	}
-	dev_err(&data->client->dev, "unsupported sgp version: %d.%d\n",
-		major, minor);
+	dev_err(dev, "unsupported sgp version: %d.%d\n", major, minor);
 
 	return -ENODEV;
 }
@@ -499,17 +498,18 @@ static const struct of_device_id sgp_dt_ids[] = {
 static int sgp_probe(struct i2c_client *client,
 		     const struct i2c_device_id *id)
 {
+	struct device *dev = &client->dev;
 	struct iio_dev *indio_dev;
 	struct sgp_data *data;
 	const struct of_device_id *of_id;
 	unsigned long product_id;
 	int ret;
 
-	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
+	indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
 	if (!indio_dev)
 		return -ENOMEM;
 
-	of_id = of_match_device(sgp_dt_ids, &client->dev);
+	of_id = of_match_device(sgp_dt_ids, dev);
 	if (of_id)
 		product_id = (unsigned long)of_id->data;
 	else
@@ -541,9 +541,9 @@ static int sgp_probe(struct i2c_client *client,
 
 	sgp_init(data);
 
-	ret = devm_iio_device_register(&client->dev, indio_dev);
+	ret = devm_iio_device_register(dev, indio_dev);
 	if (ret) {
-		dev_err(&client->dev, "failed to register iio device\n");
+		dev_err(dev, "failed to register iio device\n");
 		return ret;
 	}
 
-- 
2.28.0


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

* [PATCH 27/38] iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (25 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 26/38] iio:chemical:sgp30: Use local variable dev to simplify code Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 28/38] iio:chemical:vz89x: Introduce local struct device pointer Jonathan Cameron
                   ` (11 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Andreas Brauchli

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This change allow the driver to be used with ACPI PRP0001 and removes
an antipattern that I want to avoid being copied into new IIO drivers.

The handling of match_data uses a different approach as
device_get_match_data doesn't distinguish between no match, and
a match but with NULL data.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andreas Brauchli <andreas.brauchli@sensirion.com>
---
 drivers/iio/chemical/sgp30.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c
index 410565aa20b6..c2d93b9796ce 100644
--- a/drivers/iio/chemical/sgp30.c
+++ b/drivers/iio/chemical/sgp30.c
@@ -20,9 +20,9 @@
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
 #include <linux/i2c.h>
-#include <linux/of_device.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 
@@ -501,7 +501,6 @@ static int sgp_probe(struct i2c_client *client,
 	struct device *dev = &client->dev;
 	struct iio_dev *indio_dev;
 	struct sgp_data *data;
-	const struct of_device_id *of_id;
 	unsigned long product_id;
 	int ret;
 
@@ -509,9 +508,8 @@ static int sgp_probe(struct i2c_client *client,
 	if (!indio_dev)
 		return -ENOMEM;
 
-	of_id = of_match_device(sgp_dt_ids, dev);
-	if (of_id)
-		product_id = (unsigned long)of_id->data;
+	if (dev_fwnode(dev))
+		product_id = (unsigned long)device_get_match_data(dev);
 	else
 		product_id = id->driver_data;
 
@@ -576,7 +574,7 @@ MODULE_DEVICE_TABLE(of, sgp_dt_ids);
 static struct i2c_driver sgp_driver = {
 	.driver = {
 		.name = "sgp30",
-		.of_match_table = of_match_ptr(sgp_dt_ids),
+		.of_match_table = sgp_dt_ids,
 	},
 	.probe = sgp_probe,
 	.remove = sgp_remove,
-- 
2.28.0


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

* [PATCH 28/38] iio:chemical:vz89x: Introduce local struct device pointer.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (26 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 27/38] iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 19:02   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 29/38] iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors Jonathan Cameron
                   ` (10 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Avoids lots of repition of &client->dev and will make the next
patch tidier.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/vz89x.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
index 5586eb8e12cd..3cd469578590 100644
--- a/drivers/iio/chemical/vz89x.c
+++ b/drivers/iio/chemical/vz89x.c
@@ -352,12 +352,13 @@ MODULE_DEVICE_TABLE(of, vz89x_dt_ids);
 static int vz89x_probe(struct i2c_client *client,
 		       const struct i2c_device_id *id)
 {
+	struct device *dev = &client->dev;
 	struct iio_dev *indio_dev;
 	struct vz89x_data *data;
 	const struct of_device_id *of_id;
 	int chip_id;
 
-	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
+	indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
 	if (!indio_dev)
 		return -ENOMEM;
 	data = iio_priv(indio_dev);
@@ -370,7 +371,7 @@ static int vz89x_probe(struct i2c_client *client,
 	else
 		return -EOPNOTSUPP;
 
-	of_id = of_match_device(vz89x_dt_ids, &client->dev);
+	of_id = of_match_device(vz89x_dt_ids, dev);
 	if (!of_id)
 		chip_id = id->driver_data;
 	else
@@ -383,13 +384,13 @@ static int vz89x_probe(struct i2c_client *client,
 	mutex_init(&data->lock);
 
 	indio_dev->info = &vz89x_info;
-	indio_dev->name = dev_name(&client->dev);
+	indio_dev->name = dev_name(dev);
 	indio_dev->modes = INDIO_DIRECT_MODE;
 
 	indio_dev->channels = data->chip->channels;
 	indio_dev->num_channels = data->chip->num_channels;
 
-	return devm_iio_device_register(&client->dev, indio_dev);
+	return devm_iio_device_register(dev, indio_dev);
 }
 
 static const struct i2c_device_id vz89x_id[] = {
-- 
2.28.0


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

* [PATCH 29/38] iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (27 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 28/38] iio:chemical:vz89x: Introduce local struct device pointer Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 19:03   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 30/38] iio:humidity:hdc100x: Drop of_match_ptr protection Jonathan Cameron
                   ` (9 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This change allow the driver to be used with ACPI PRP0001 and removes
an antipattern that I want to avoid being copied into new IIO drivers.

The handling of match_data uses a different approach as
device_get_match_data() doesn't distinguish between no match, and
a match but with NULL data.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/vz89x.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
index 3cd469578590..23b22a5f5c1c 100644
--- a/drivers/iio/chemical/vz89x.c
+++ b/drivers/iio/chemical/vz89x.c
@@ -10,8 +10,7 @@
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/i2c.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -355,7 +354,6 @@ static int vz89x_probe(struct i2c_client *client,
 	struct device *dev = &client->dev;
 	struct iio_dev *indio_dev;
 	struct vz89x_data *data;
-	const struct of_device_id *of_id;
 	int chip_id;
 
 	indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
@@ -371,11 +369,10 @@ static int vz89x_probe(struct i2c_client *client,
 	else
 		return -EOPNOTSUPP;
 
-	of_id = of_match_device(vz89x_dt_ids, dev);
-	if (!of_id)
+	if (!dev_fwnode(dev))
 		chip_id = id->driver_data;
 	else
-		chip_id = (unsigned long)of_id->data;
+		chip_id = (unsigned long)device_get_match_data(dev);
 
 	i2c_set_clientdata(client, indio_dev);
 	data->client = client;
@@ -403,7 +400,7 @@ MODULE_DEVICE_TABLE(i2c, vz89x_id);
 static struct i2c_driver vz89x_driver = {
 	.driver = {
 		.name	= "vz89x",
-		.of_match_table = of_match_ptr(vz89x_dt_ids),
+		.of_match_table = vz89x_dt_ids,
 	},
 	.probe = vz89x_probe,
 	.id_table = vz89x_id,
-- 
2.28.0


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

* [PATCH 30/38] iio:humidity:hdc100x: Drop of_match_ptr protection.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (28 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 29/38] iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:59   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 31/38] iio:proximity:as3935: Use local struct device pointer to simplify code Jonathan Cameron
                   ` (8 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/humidity/hdc100x.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c
index 071cb2b12bb6..2a957f19048e 100644
--- a/drivers/iio/humidity/hdc100x.c
+++ b/drivers/iio/humidity/hdc100x.c
@@ -15,6 +15,7 @@
 
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/init.h>
 #include <linux/i2c.h>
 
@@ -417,7 +418,7 @@ MODULE_DEVICE_TABLE(of, hdc100x_dt_ids);
 static struct i2c_driver hdc100x_driver = {
 	.driver = {
 		.name	= "hdc100x",
-		.of_match_table = of_match_ptr(hdc100x_dt_ids),
+		.of_match_table = hdc100x_dt_ids,
 	},
 	.probe = hdc100x_probe,
 	.id_table = hdc100x_id,
-- 
2.28.0


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

* [PATCH 31/38] iio:proximity:as3935: Use local struct device pointer to simplify code.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (29 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 30/38] iio:humidity:hdc100x: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:56   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 32/38] iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
                   ` (7 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This makes the existing code easier to read and will make the following
patch a little simpler.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/proximity/as3935.c | 38 ++++++++++++++++------------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
index c339e7339ec8..4df8d53d65fb 100644
--- a/drivers/iio/proximity/as3935.c
+++ b/drivers/iio/proximity/as3935.c
@@ -352,19 +352,20 @@ static void as3935_stop_work(void *data)
 
 static int as3935_probe(struct spi_device *spi)
 {
+	struct device *dev = &spi->dev;
 	struct iio_dev *indio_dev;
 	struct iio_trigger *trig;
 	struct as3935_state *st;
-	struct device_node *np = spi->dev.of_node;
+	struct device_node *np = dev->of_node;
 	int ret;
 
 	/* Be sure lightning event interrupt is specified */
 	if (!spi->irq) {
-		dev_err(&spi->dev, "unable to get event interrupt\n");
+		dev_err(dev, "unable to get event interrupt\n");
 		return -EINVAL;
 	}
 
-	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
+	indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
 	if (!indio_dev)
 		return -ENOMEM;
 
@@ -378,14 +379,12 @@ static int as3935_probe(struct spi_device *spi)
 			"ams,tuning-capacitor-pf", &st->tune_cap);
 	if (ret) {
 		st->tune_cap = 0;
-		dev_warn(&spi->dev,
-			"no tuning-capacitor-pf set, defaulting to %d",
+		dev_warn(dev, "no tuning-capacitor-pf set, defaulting to %d",
 			st->tune_cap);
 	}
 
 	if (st->tune_cap > MAX_PF_CAP) {
-		dev_err(&spi->dev,
-			"wrong tuning-capacitor-pf setting of %d\n",
+		dev_err(dev, "wrong tuning-capacitor-pf setting of %d\n",
 			st->tune_cap);
 		return -EINVAL;
 	}
@@ -393,8 +392,7 @@ static int as3935_probe(struct spi_device *spi)
 	ret = of_property_read_u32(np,
 			"ams,nflwdth", &st->nflwdth_reg);
 	if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
-		dev_err(&spi->dev,
-			"invalid nflwdth setting of %d\n",
+		dev_err(dev, "invalid nflwdth setting of %d\n",
 			st->nflwdth_reg);
 		return -EINVAL;
 	}
@@ -405,7 +403,7 @@ static int as3935_probe(struct spi_device *spi)
 	indio_dev->modes = INDIO_DIRECT_MODE;
 	indio_dev->info = &as3935_info;
 
-	trig = devm_iio_trigger_alloc(&spi->dev, "%s-dev%d",
+	trig = devm_iio_trigger_alloc(dev, "%s-dev%d",
 				      indio_dev->name, indio_dev->id);
 
 	if (!trig)
@@ -417,42 +415,42 @@ static int as3935_probe(struct spi_device *spi)
 	iio_trigger_set_drvdata(trig, indio_dev);
 	trig->ops = &iio_interrupt_trigger_ops;
 
-	ret = devm_iio_trigger_register(&spi->dev, trig);
+	ret = devm_iio_trigger_register(dev, trig);
 	if (ret) {
-		dev_err(&spi->dev, "failed to register trigger\n");
+		dev_err(dev, "failed to register trigger\n");
 		return ret;
 	}
 
-	ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev,
+	ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
 					      iio_pollfunc_store_time,
 					      as3935_trigger_handler, NULL);
 
 	if (ret) {
-		dev_err(&spi->dev, "cannot setup iio trigger\n");
+		dev_err(dev, "cannot setup iio trigger\n");
 		return ret;
 	}
 
 	calibrate_as3935(st);
 
 	INIT_DELAYED_WORK(&st->work, as3935_event_work);
-	ret = devm_add_action(&spi->dev, as3935_stop_work, indio_dev);
+	ret = devm_add_action(dev, as3935_stop_work, indio_dev);
 	if (ret)
 		return ret;
 
-	ret = devm_request_irq(&spi->dev, spi->irq,
+	ret = devm_request_irq(dev, spi->irq,
 				&as3935_interrupt_handler,
 				IRQF_TRIGGER_RISING,
-				dev_name(&spi->dev),
+				dev_name(dev),
 				indio_dev);
 
 	if (ret) {
-		dev_err(&spi->dev, "unable to request irq\n");
+		dev_err(dev, "unable to request irq\n");
 		return ret;
 	}
 
-	ret = devm_iio_device_register(&spi->dev, indio_dev);
+	ret = devm_iio_device_register(dev, indio_dev);
 	if (ret < 0) {
-		dev_err(&spi->dev, "unable to register device\n");
+		dev_err(dev, "unable to register device\n");
 		return ret;
 	}
 	return 0;
-- 
2.28.0


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

* [PATCH 32/38] iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (30 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 31/38] iio:proximity:as3935: Use local struct device pointer to simplify code Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:55   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 33/38] iio:proximity:pulsedlight: Drop of_match_ptr protection Jonathan Cameron
                   ` (6 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This change allows the driver to be used with ACPI PRP0001 and removes
an antipattern that I want to avoid being copied into new IIO drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/proximity/as3935.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
index 4df8d53d65fb..b79ada839e01 100644
--- a/drivers/iio/proximity/as3935.c
+++ b/drivers/iio/proximity/as3935.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -356,7 +357,6 @@ static int as3935_probe(struct spi_device *spi)
 	struct iio_dev *indio_dev;
 	struct iio_trigger *trig;
 	struct as3935_state *st;
-	struct device_node *np = dev->of_node;
 	int ret;
 
 	/* Be sure lightning event interrupt is specified */
@@ -375,7 +375,7 @@ static int as3935_probe(struct spi_device *spi)
 	spi_set_drvdata(spi, indio_dev);
 	mutex_init(&st->lock);
 
-	ret = of_property_read_u32(np,
+	ret = device_property_read_u32(dev,
 			"ams,tuning-capacitor-pf", &st->tune_cap);
 	if (ret) {
 		st->tune_cap = 0;
@@ -389,7 +389,7 @@ static int as3935_probe(struct spi_device *spi)
 		return -EINVAL;
 	}
 
-	ret = of_property_read_u32(np,
+	ret = device_property_read_u32(dev,
 			"ams,nflwdth", &st->nflwdth_reg);
 	if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
 		dev_err(dev, "invalid nflwdth setting of %d\n",
@@ -471,7 +471,7 @@ MODULE_DEVICE_TABLE(spi, as3935_id);
 static struct spi_driver as3935_driver = {
 	.driver = {
 		.name	= "as3935",
-		.of_match_table = of_match_ptr(as3935_of_match),
+		.of_match_table = as3935_of_match,
 		.pm	= AS3935_PM_OPS,
 	},
 	.probe		= as3935_probe,
-- 
2.28.0


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

* [PATCH 33/38] iio:proximity:pulsedlight: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (31 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 32/38] iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:55   ` Matt Ranostay
  2020-09-10 17:32 ` [PATCH 34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections Jonathan Cameron
                   ` (5 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
index a8e716dbd24e..c685f10b5ae4 100644
--- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
+++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
@@ -13,6 +13,7 @@
 #include <linux/i2c.h>
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/pm_runtime.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -360,7 +361,7 @@ static const struct dev_pm_ops lidar_pm_ops = {
 static struct i2c_driver lidar_driver = {
 	.driver = {
 		.name	= LIDAR_DRV_NAME,
-		.of_match_table	= of_match_ptr(lidar_dt_ids),
+		.of_match_table	= lidar_dt_ids,
 		.pm	= &lidar_pm_ops,
 	},
 	.probe		= lidar_probe,
-- 
2.28.0


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

* [PATCH 34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (32 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 33/38] iio:proximity:pulsedlight: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-11 18:59   ` Jonathan Albrieux
  2020-09-10 17:32 ` [PATCH 35/38] iio:magn:ak8974: Drop of_match_ptr protection Jonathan Cameron
                   ` (4 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Jonathan Albrieux

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Both would result in only a small size saving.  For simplicity it
is best to remove them.  I also wish to remove both these antipatterns
from IIO.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jonathan Albrieux <jonathan.albrieux@gmail.com>
---
 drivers/iio/magnetometer/ak8975.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index 03d71f796177..0141ef3b6476 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/i2c.h>
@@ -17,7 +18,6 @@
 #include <linux/delay.h>
 #include <linux/bitops.h>
 #include <linux/gpio/consumer.h>
-#include <linux/acpi.h>
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 
@@ -773,7 +773,6 @@ static const struct iio_info ak8975_info = {
 	.read_raw = &ak8975_read_raw,
 };
 
-#ifdef CONFIG_ACPI
 static const struct acpi_device_id ak_acpi_match[] = {
 	{"AK8975", AK8975},
 	{"AK8963", AK8963},
@@ -785,7 +784,6 @@ static const struct acpi_device_id ak_acpi_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, ak_acpi_match);
-#endif
 
 static void ak8975_fill_buffer(struct iio_dev *indio_dev)
 {
@@ -1075,8 +1073,8 @@ static struct i2c_driver ak8975_driver = {
 	.driver = {
 		.name	= "ak8975",
 		.pm = &ak8975_dev_pm_ops,
-		.of_match_table = of_match_ptr(ak8975_of_match),
-		.acpi_match_table = ACPI_PTR(ak_acpi_match),
+		.of_match_table = ak8975_of_match,
+		.acpi_match_table = ak_acpi_match,
 	},
 	.probe		= ak8975_probe,
 	.remove		= ak8975_remove,
-- 
2.28.0


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

* [PATCH 35/38] iio:magn:ak8974: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (33 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-29 12:40   ` Linus Walleij
  2020-09-10 17:32 ` [PATCH 36/38] iio:humidity:htu21: " Jonathan Cameron
                   ` (3 subsequent siblings)
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Linus Walleij

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/iio/magnetometer/ak8974.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c
index 7cd9768fbcb2..df5131cf28a9 100644
--- a/drivers/iio/magnetometer/ak8974.c
+++ b/drivers/iio/magnetometer/ak8974.c
@@ -12,6 +12,7 @@
  * Author: Linus Walleij <linus.walleij@linaro.org>
  */
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/kernel.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
@@ -1051,7 +1052,7 @@ static struct i2c_driver ak8974_driver = {
 	.driver	 = {
 		.name	= "ak8974",
 		.pm = &ak8974_dev_pm_ops,
-		.of_match_table = of_match_ptr(ak8974_of_match),
+		.of_match_table = ak8974_of_match,
 	},
 	.probe	  = ak8974_probe,
 	.remove	  = ak8974_remove,
-- 
2.28.0


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

* [PATCH 36/38] iio:humidity:htu21: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (34 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 35/38] iio:magn:ak8974: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 37/38] iio:humidity:si7020: " Jonathan Cameron
                   ` (2 subsequent siblings)
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Ludovic Tancerel

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
---
 drivers/iio/humidity/htu21.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/humidity/htu21.c b/drivers/iio/humidity/htu21.c
index 4f5d9d1c05ab..36df2a102ca4 100644
--- a/drivers/iio/humidity/htu21.c
+++ b/drivers/iio/humidity/htu21.c
@@ -19,6 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/stat.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 
@@ -247,7 +248,7 @@ static struct i2c_driver htu21_driver = {
 	.id_table = htu21_id,
 	.driver = {
 		   .name = "htu21",
-		   .of_match_table = of_match_ptr(htu21_of_match),
+		   .of_match_table = htu21_of_match,
 		   },
 };
 
-- 
2.28.0


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

* [PATCH 37/38] iio:humidity:si7020: Drop of_match_ptr protection
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (35 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 36/38] iio:humidity:htu21: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-10 17:32 ` [PATCH 38/38] iio:health:max30102: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
  2020-09-14  8:04 ` [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Andy Shevchenko
  38 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, David Barksdale

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This prevents use of this driver with ACPI via PRP0001 and is
an example of an anti pattern I'm trying to remove from IIO.
Hence drop from this driver.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: David Barksdale <dbarksdale@uplogix.com>
---
 drivers/iio/humidity/si7020.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c
index a09b5773d377..ab6537f136ba 100644
--- a/drivers/iio/humidity/si7020.c
+++ b/drivers/iio/humidity/si7020.c
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/slab.h>
 #include <linux/sysfs.h>
 
@@ -153,7 +154,7 @@ MODULE_DEVICE_TABLE(of, si7020_dt_ids);
 static struct i2c_driver si7020_driver = {
 	.driver = {
 		.name = "si7020",
-		.of_match_table = of_match_ptr(si7020_dt_ids),
+		.of_match_table = si7020_dt_ids,
 	},
 	.probe		= si7020_probe,
 	.id_table	= si7020_id,
-- 
2.28.0


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

* [PATCH 38/38] iio:health:max30102: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (36 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 37/38] iio:humidity:si7020: " Jonathan Cameron
@ 2020-09-10 17:32 ` Jonathan Cameron
  2020-09-15 18:54   ` Matt Ranostay
  2020-09-14  8:04 ` [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Andy Shevchenko
  38 siblings, 1 reply; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-10 17:32 UTC (permalink / raw)
  To: linux-iio; +Cc: Andy Shevchenko, Jonathan Cameron, Matt Ranostay

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This enables use of the driver with ACPI PRP0001 and also removes
an antipattern that I am trying to clear out of IIO to avoid
it being coppied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/health/max30102.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/health/max30102.c b/drivers/iio/health/max30102.c
index bb504e993f19..543021d8df34 100644
--- a/drivers/iio/health/max30102.c
+++ b/drivers/iio/health/max30102.c
@@ -19,7 +19,7 @@
 #include <linux/irq.h>
 #include <linux/i2c.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regmap.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
@@ -323,11 +323,10 @@ static int max30102_get_current_idx(unsigned int val, int *reg)
 static int max30102_led_init(struct max30102_data *data)
 {
 	struct device *dev = &data->client->dev;
-	struct device_node *np = dev->of_node;
 	unsigned int val;
 	int reg, ret;
 
-	ret = of_property_read_u32(np, "maxim,red-led-current-microamp", &val);
+	ret = device_property_read_u32(dev, "maxim,red-led-current-microamp", &val);
 	if (ret) {
 		dev_info(dev, "no red-led-current-microamp set\n");
 
@@ -346,7 +345,7 @@ static int max30102_led_init(struct max30102_data *data)
 		return ret;
 
 	if (data->chip_id == max30105) {
-		ret = of_property_read_u32(np,
+		ret = device_property_read_u32(dev,
 			"maxim,green-led-current-microamp", &val);
 		if (ret) {
 			dev_info(dev, "no green-led-current-microamp set\n");
@@ -368,7 +367,7 @@ static int max30102_led_init(struct max30102_data *data)
 			return ret;
 	}
 
-	ret = of_property_read_u32(np, "maxim,ir-led-current-microamp", &val);
+	ret = device_property_read_u32(dev, "maxim,ir-led-current-microamp", &val);
 	if (ret) {
 		dev_info(dev, "no ir-led-current-microamp set\n");
 
@@ -624,7 +623,7 @@ MODULE_DEVICE_TABLE(of, max30102_dt_ids);
 static struct i2c_driver max30102_driver = {
 	.driver = {
 		.name	= MAX30102_DRV_NAME,
-		.of_match_table	= of_match_ptr(max30102_dt_ids),
+		.of_match_table	= max30102_dt_ids,
 	},
 	.probe		= max30102_probe,
 	.remove		= max30102_remove,
-- 
2.28.0


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

* Re: [PATCH 34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.
  2020-09-10 17:32 ` [PATCH 34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections Jonathan Cameron
@ 2020-09-11 18:59   ` Jonathan Albrieux
  0 siblings, 0 replies; 55+ messages in thread
From: Jonathan Albrieux @ 2020-09-11 18:59 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 06:32:38PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Both would result in only a small size saving.  For simplicity it
> is best to remove them.  I also wish to remove both these antipatterns
> from IIO.
>

Hi Jonathan and thank you!

I compiled and tested this patch on ak09911 so, for what is worth,

Acked-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Tested-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>

Best regards,
Jonathan

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Jonathan Albrieux <jonathan.albrieux@gmail.com>
> ---
>  drivers/iio/magnetometer/ak8975.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index 03d71f796177..0141ef3b6476 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/kernel.h>
>  #include <linux/slab.h>
>  #include <linux/i2c.h>
> @@ -17,7 +18,6 @@
>  #include <linux/delay.h>
>  #include <linux/bitops.h>
>  #include <linux/gpio/consumer.h>
> -#include <linux/acpi.h>
>  #include <linux/regulator/consumer.h>
>  #include <linux/pm_runtime.h>
>  
> @@ -773,7 +773,6 @@ static const struct iio_info ak8975_info = {
>  	.read_raw = &ak8975_read_raw,
>  };
>  
> -#ifdef CONFIG_ACPI
>  static const struct acpi_device_id ak_acpi_match[] = {
>  	{"AK8975", AK8975},
>  	{"AK8963", AK8963},
> @@ -785,7 +784,6 @@ static const struct acpi_device_id ak_acpi_match[] = {
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, ak_acpi_match);
> -#endif
>  
>  static void ak8975_fill_buffer(struct iio_dev *indio_dev)
>  {
> @@ -1075,8 +1073,8 @@ static struct i2c_driver ak8975_driver = {
>  	.driver = {
>  		.name	= "ak8975",
>  		.pm = &ak8975_dev_pm_ops,
> -		.of_match_table = of_match_ptr(ak8975_of_match),
> -		.acpi_match_table = ACPI_PTR(ak_acpi_match),
> +		.of_match_table = ak8975_of_match,
> +		.acpi_match_table = ak_acpi_match,
>  	},
>  	.probe		= ak8975_probe,
>  	.remove		= ak8975_remove,
> -- 
> 2.28.0
> 

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

* Re: [PATCH 00/38] iio: remaining easy of_match_ptr removal and related.
  2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
                   ` (37 preceding siblings ...)
  2020-09-10 17:32 ` [PATCH 38/38] iio:health:max30102: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-14  8:04 ` Andy Shevchenko
  2020-09-17 18:17   ` Jonathan Cameron
  38 siblings, 1 reply; 55+ messages in thread
From: Andy Shevchenko @ 2020-09-14  8:04 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Jonathan Cameron

On Thu, Sep 10, 2020 at 8:35 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This bumper set removes all the remaining cases where of_match_ptr
> is mostly serving to prevent use of the device via ACPI PRP0001 and
> complicating the code. The main aim of this set is to reduce the chances
> of it being used in future drivers.
> It also includes some related refactorings, use of generic fw accessors,
> dropping of CONFIG_OF and lots of header changes inline with the above.
>
> For examples of how to use PRP0001 see https://github.com/westeri/meta-acpi
> which is an excellent resource from which to copy snippets of DSDT tables.
>
> It may well not be worth changing the remaining 10 IIO drivers and I
> certainly don't plan to do so anytime soon.
>

I briefly looked at the series and didn't see anything wrong with it
(esp. taking into consideration that you are already familiar with the
topic).
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Jonathan Cameron (38):
>   iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections.
>   iio:potentiometer:ds1803: Drop of_match_ptr and CONFIG_OF protections
>   iio:potentiometer:max5432: Drop of_match_ptr and use generic fw
>     accessors
>   iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF
>     protections.
>   iio:potentiometer:max5481: Drop invalid ACPI binding.
>   iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF
>     protections.
>   iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw
>     interfaces.
>   iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF
>     protections.
>   iio:dac:ad5446: Drop of_match_ptr and CONFIG_OF protections
>   iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections.
>   iio:dac:ad5593r: Drop of_match_ptr and ACPI_PTR protections.
>   iio:dac:ad7303: Drop of_match_ptr protection
>   iio:dac:mcp4725: drop of_match_ptr and use generic fw properties
>   iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections
>   iio:dac:ti-dac5571: Drop of_match_ptr and CONFIG_OF protections
>   iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw
>     accessors
>   iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections
>   iio:pressure:ms5611: Drop of_match_ptr and CONFIG_OF protections
>   iio:pressure:ms5637: Drop of_match_ptr protection
>   iio:pressure:zpa2326: Drop of_match_ptr protection
>   iio:temperature:tsys01: Drop of_match_ptr protection
>   iio:temperature:tmp007: Drop of_match_ptr protection
>   iio:resolver:ad2s1200: Drop of_match_ptr protection
>   iio:chemical:ams-iaq-core: Drop of_match_ptr protection
>   iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw
>     accessors
>   iio:chemical:sgp30: Use local variable dev to simplify code
>   iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors
>   iio:chemical:vz89x: Introduce local struct device pointer.
>   iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw
>     accessors
>   iio:humidity:hdc100x: Drop of_match_ptr protection.
>   iio:proximity:as3935: Use local struct device pointer to simplify
>     code.
>   iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors
>   iio:proximity:pulsedlight: Drop of_match_ptr protection
>   iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.
>   iio:magn:ak8974: Drop of_match_ptr protection
>   iio:humidity:htu21: Drop of_match_ptr protection
>   iio:humidity:si7020: Drop of_match_ptr protection
>   iio:health:max30102: Drop of_match_ptr and use generic fw accessors
>
>  drivers/iio/chemical/ams-iaq-core.c           |  3 +-
>  drivers/iio/chemical/atlas-sensor.c           | 10 ++---
>  drivers/iio/chemical/sgp30.c                  | 28 ++++++------
>  drivers/iio/chemical/vz89x.c                  | 18 ++++----
>  drivers/iio/dac/ad5446.c                      |  5 +--
>  drivers/iio/dac/ad5592r.c                     |  7 ++-
>  drivers/iio/dac/ad5593r.c                     |  7 ++-
>  drivers/iio/dac/ad7303.c                      |  3 +-
>  drivers/iio/dac/mcp4725.c                     | 29 +++---------
>  drivers/iio/dac/ti-dac082s085.c               |  5 +--
>  drivers/iio/dac/ti-dac5571.c                  |  7 +--
>  drivers/iio/health/max30102.c                 | 11 +++--
>  drivers/iio/humidity/hdc100x.c                |  3 +-
>  drivers/iio/humidity/htu21.c                  |  3 +-
>  drivers/iio/humidity/si7020.c                 |  3 +-
>  drivers/iio/magnetometer/ak8974.c             |  3 +-
>  drivers/iio/magnetometer/ak8975.c             |  8 ++--
>  drivers/iio/potentiometer/ad5272.c            |  5 +--
>  drivers/iio/potentiometer/ds1803.c            |  6 +--
>  drivers/iio/potentiometer/max5432.c           |  8 ++--
>  drivers/iio/potentiometer/max5481.c           | 23 ++--------
>  drivers/iio/potentiometer/mcp4018.c           | 12 ++---
>  drivers/iio/potentiometer/mcp4131.c           |  8 ++--
>  drivers/iio/potentiometer/mcp4531.c           | 11 ++---
>  drivers/iio/potentiostat/lmp91000.c           | 11 +++--
>  drivers/iio/pressure/icp10100.c               |  3 +-
>  drivers/iio/pressure/ms5611_i2c.c             |  6 +--
>  drivers/iio/pressure/ms5611_spi.c             |  6 +--
>  drivers/iio/pressure/ms5637.c                 |  3 +-
>  drivers/iio/pressure/zpa2326_i2c.c            |  6 +--
>  drivers/iio/pressure/zpa2326_spi.c            |  6 +--
>  drivers/iio/proximity/as3935.c                | 44 +++++++++----------
>  .../iio/proximity/pulsedlight-lidar-lite-v2.c |  3 +-
>  drivers/iio/resolver/ad2s1200.c               |  3 +-
>  drivers/iio/temperature/tmp007.c              |  4 +-
>  drivers/iio/temperature/tsys01.c              |  3 +-
>  36 files changed, 134 insertions(+), 190 deletions(-)
>
> --
> 2.28.0
>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 05/38] iio:potentiometer:max5481: Drop invalid ACPI binding.
  2020-09-10 17:32 ` [PATCH 05/38] iio:potentiometer:max5481: Drop invalid ACPI binding Jonathan Cameron
@ 2020-09-14  8:07   ` Andy Shevchenko
  0 siblings, 0 replies; 55+ messages in thread
From: Andy Shevchenko @ 2020-09-14  8:07 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Jonathan Cameron, Maury Anderson, Matthew Weber,
	Slawomir Stepien

On Thu, Sep 10, 2020 at 8:35 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Given that an ACPI binding must start with 3 or 4 capitals,
> this cannot represent a valid binding.
>
> It seems unlikely anything out there is using it.

Totally agree.
The names are dictated by the ACPI specification and don't mention
small letters.

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Maury Anderson <maury.anderson@rockwellcollins.com>
> Cc: Matthew Weber <matthew.weber@rockwellcollins.com>
> Cc: Slawomir Stepien <sst@poczta.fm>
> ---
>  drivers/iio/potentiometer/max5481.c | 13 -------------
>  1 file changed, 13 deletions(-)
>
> diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c
> index 6d1e1a57cba1..a88ed0eb3adc 100644
> --- a/drivers/iio/potentiometer/max5481.c
> +++ b/drivers/iio/potentiometer/max5481.c
> @@ -7,7 +7,6 @@
>   * https://datasheets.maximintegrated.com/en/ds/MAX5481-MAX5484.pdf
>   */
>
> -#include <linux/acpi.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
>  #include <linux/module.h>
> @@ -182,22 +181,10 @@ static const struct spi_device_id max5481_id_table[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, max5481_id_table);
>
> -#if defined(CONFIG_ACPI)
> -static const struct acpi_device_id max5481_acpi_match[] = {
> -       { "max5481", max5481 },
> -       { "max5482", max5482 },
> -       { "max5483", max5483 },
> -       { "max5484", max5484 },
> -       { }
> -};
> -MODULE_DEVICE_TABLE(acpi, max5481_acpi_match);
> -#endif
> -
>  static struct spi_driver max5481_driver = {
>         .driver = {
>                 .name  = "max5481",
>                 .of_match_table = max5481_match,
> -               .acpi_match_table = ACPI_PTR(max5481_acpi_match),
>         },
>         .probe = max5481_probe,
>         .remove = max5481_remove,
> --
> 2.28.0
>


-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 38/38] iio:health:max30102: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 ` [PATCH 38/38] iio:health:max30102: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-15 18:54   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:54 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:36 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This enables use of the driver with ACPI PRP0001 and also removes
> an antipattern that I am trying to clear out of IIO to avoid
> it being coppied into new drivers.

Typo, should be copied.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/health/max30102.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/health/max30102.c b/drivers/iio/health/max30102.c
> index bb504e993f19..543021d8df34 100644
> --- a/drivers/iio/health/max30102.c
> +++ b/drivers/iio/health/max30102.c
> @@ -19,7 +19,7 @@
>  #include <linux/irq.h>
>  #include <linux/i2c.h>
>  #include <linux/mutex.h>
> -#include <linux/of.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/regmap.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/buffer.h>
> @@ -323,11 +323,10 @@ static int max30102_get_current_idx(unsigned int val, int *reg)
>  static int max30102_led_init(struct max30102_data *data)
>  {
>         struct device *dev = &data->client->dev;
> -       struct device_node *np = dev->of_node;
>         unsigned int val;
>         int reg, ret;
>
> -       ret = of_property_read_u32(np, "maxim,red-led-current-microamp", &val);
> +       ret = device_property_read_u32(dev, "maxim,red-led-current-microamp", &val);
>         if (ret) {
>                 dev_info(dev, "no red-led-current-microamp set\n");
>
> @@ -346,7 +345,7 @@ static int max30102_led_init(struct max30102_data *data)
>                 return ret;
>
>         if (data->chip_id == max30105) {
> -               ret = of_property_read_u32(np,
> +               ret = device_property_read_u32(dev,
>                         "maxim,green-led-current-microamp", &val);
>                 if (ret) {
>                         dev_info(dev, "no green-led-current-microamp set\n");
> @@ -368,7 +367,7 @@ static int max30102_led_init(struct max30102_data *data)
>                         return ret;
>         }
>
> -       ret = of_property_read_u32(np, "maxim,ir-led-current-microamp", &val);
> +       ret = device_property_read_u32(dev, "maxim,ir-led-current-microamp", &val);
>         if (ret) {
>                 dev_info(dev, "no ir-led-current-microamp set\n");
>
> @@ -624,7 +623,7 @@ MODULE_DEVICE_TABLE(of, max30102_dt_ids);
>  static struct i2c_driver max30102_driver = {
>         .driver = {
>                 .name   = MAX30102_DRV_NAME,
> -               .of_match_table = of_match_ptr(max30102_dt_ids),
> +               .of_match_table = max30102_dt_ids,
>         },
>         .probe          = max30102_probe,
>         .remove         = max30102_remove,
> --
> 2.28.0
>

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

* Re: [PATCH 33/38] iio:proximity:pulsedlight: Drop of_match_ptr protection
  2020-09-10 17:32 ` [PATCH 33/38] iio:proximity:pulsedlight: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-15 18:55   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:55 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This prevents use of this driver with ACPI via PRP0001 and is
> an example of an anti pattern I'm trying to remove from IIO.
> Hence drop from this driver.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> index a8e716dbd24e..c685f10b5ae4 100644
> --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> @@ -13,6 +13,7 @@
>  #include <linux/i2c.h>
>  #include <linux/delay.h>
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> @@ -360,7 +361,7 @@ static const struct dev_pm_ops lidar_pm_ops = {
>  static struct i2c_driver lidar_driver = {
>         .driver = {
>                 .name   = LIDAR_DRV_NAME,
> -               .of_match_table = of_match_ptr(lidar_dt_ids),
> +               .of_match_table = lidar_dt_ids,
>                 .pm     = &lidar_pm_ops,
>         },
>         .probe          = lidar_probe,
> --
> 2.28.0
>

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

* Re: [PATCH 32/38] iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 ` [PATCH 32/38] iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-15 18:55   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:55 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This change allows the driver to be used with ACPI PRP0001 and removes
> an antipattern that I want to avoid being copied into new IIO drivers.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/proximity/as3935.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
> index 4df8d53d65fb..b79ada839e01 100644
> --- a/drivers/iio/proximity/as3935.c
> +++ b/drivers/iio/proximity/as3935.c
> @@ -7,6 +7,7 @@
>   */
>
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/init.h>
>  #include <linux/interrupt.h>
>  #include <linux/delay.h>
> @@ -356,7 +357,6 @@ static int as3935_probe(struct spi_device *spi)
>         struct iio_dev *indio_dev;
>         struct iio_trigger *trig;
>         struct as3935_state *st;
> -       struct device_node *np = dev->of_node;
>         int ret;
>
>         /* Be sure lightning event interrupt is specified */
> @@ -375,7 +375,7 @@ static int as3935_probe(struct spi_device *spi)
>         spi_set_drvdata(spi, indio_dev);
>         mutex_init(&st->lock);
>
> -       ret = of_property_read_u32(np,
> +       ret = device_property_read_u32(dev,
>                         "ams,tuning-capacitor-pf", &st->tune_cap);
>         if (ret) {
>                 st->tune_cap = 0;
> @@ -389,7 +389,7 @@ static int as3935_probe(struct spi_device *spi)
>                 return -EINVAL;
>         }
>
> -       ret = of_property_read_u32(np,
> +       ret = device_property_read_u32(dev,
>                         "ams,nflwdth", &st->nflwdth_reg);
>         if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
>                 dev_err(dev, "invalid nflwdth setting of %d\n",
> @@ -471,7 +471,7 @@ MODULE_DEVICE_TABLE(spi, as3935_id);
>  static struct spi_driver as3935_driver = {
>         .driver = {
>                 .name   = "as3935",
> -               .of_match_table = of_match_ptr(as3935_of_match),
> +               .of_match_table = as3935_of_match,
>                 .pm     = AS3935_PM_OPS,
>         },
>         .probe          = as3935_probe,
> --
> 2.28.0
>

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

* Re: [PATCH 24/38] iio:chemical:ams-iaq-core: Drop of_match_ptr protection
  2020-09-10 17:32 ` [PATCH 24/38] iio:chemical:ams-iaq-core: " Jonathan Cameron
@ 2020-09-15 18:55   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:55 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This prevents use of this driver with ACPI via PRP0001 and is
> an example of an anti pattern I'm trying to remove from IIO.
> Hence drop from this driver.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/chemical/ams-iaq-core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/chemical/ams-iaq-core.c b/drivers/iio/chemical/ams-iaq-core.c
> index 8c1b64fd424a..97be3669c554 100644
> --- a/drivers/iio/chemical/ams-iaq-core.c
> +++ b/drivers/iio/chemical/ams-iaq-core.c
> @@ -7,6 +7,7 @@
>   */
>
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/mutex.h>
>  #include <linux/init.h>
>  #include <linux/i2c.h>
> @@ -177,7 +178,7 @@ MODULE_DEVICE_TABLE(of, ams_iaqcore_dt_ids);
>  static struct i2c_driver ams_iaqcore_driver = {
>         .driver = {
>                 .name   = "ams-iaq-core",
> -               .of_match_table = of_match_ptr(ams_iaqcore_dt_ids),
> +               .of_match_table = ams_iaqcore_dt_ids,
>         },
>         .probe = ams_iaqcore_probe,
>         .id_table = ams_iaqcore_id,
> --
> 2.28.0
>

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

* Re: [PATCH 31/38] iio:proximity:as3935: Use local struct device pointer to simplify code.
  2020-09-10 17:32 ` [PATCH 31/38] iio:proximity:as3935: Use local struct device pointer to simplify code Jonathan Cameron
@ 2020-09-15 18:56   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:56 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This makes the existing code easier to read and will make the following
> patch a little simpler.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/proximity/as3935.c | 38 ++++++++++++++++------------------
>  1 file changed, 18 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
> index c339e7339ec8..4df8d53d65fb 100644
> --- a/drivers/iio/proximity/as3935.c
> +++ b/drivers/iio/proximity/as3935.c
> @@ -352,19 +352,20 @@ static void as3935_stop_work(void *data)
>
>  static int as3935_probe(struct spi_device *spi)
>  {
> +       struct device *dev = &spi->dev;
>         struct iio_dev *indio_dev;
>         struct iio_trigger *trig;
>         struct as3935_state *st;
> -       struct device_node *np = spi->dev.of_node;
> +       struct device_node *np = dev->of_node;
>         int ret;
>
>         /* Be sure lightning event interrupt is specified */
>         if (!spi->irq) {
> -               dev_err(&spi->dev, "unable to get event interrupt\n");
> +               dev_err(dev, "unable to get event interrupt\n");
>                 return -EINVAL;
>         }
>
> -       indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> +       indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
>         if (!indio_dev)
>                 return -ENOMEM;
>
> @@ -378,14 +379,12 @@ static int as3935_probe(struct spi_device *spi)
>                         "ams,tuning-capacitor-pf", &st->tune_cap);
>         if (ret) {
>                 st->tune_cap = 0;
> -               dev_warn(&spi->dev,
> -                       "no tuning-capacitor-pf set, defaulting to %d",
> +               dev_warn(dev, "no tuning-capacitor-pf set, defaulting to %d",
>                         st->tune_cap);
>         }
>
>         if (st->tune_cap > MAX_PF_CAP) {
> -               dev_err(&spi->dev,
> -                       "wrong tuning-capacitor-pf setting of %d\n",
> +               dev_err(dev, "wrong tuning-capacitor-pf setting of %d\n",
>                         st->tune_cap);
>                 return -EINVAL;
>         }
> @@ -393,8 +392,7 @@ static int as3935_probe(struct spi_device *spi)
>         ret = of_property_read_u32(np,
>                         "ams,nflwdth", &st->nflwdth_reg);
>         if (!ret && st->nflwdth_reg > AS3935_NFLWDTH_MASK) {
> -               dev_err(&spi->dev,
> -                       "invalid nflwdth setting of %d\n",
> +               dev_err(dev, "invalid nflwdth setting of %d\n",
>                         st->nflwdth_reg);
>                 return -EINVAL;
>         }
> @@ -405,7 +403,7 @@ static int as3935_probe(struct spi_device *spi)
>         indio_dev->modes = INDIO_DIRECT_MODE;
>         indio_dev->info = &as3935_info;
>
> -       trig = devm_iio_trigger_alloc(&spi->dev, "%s-dev%d",
> +       trig = devm_iio_trigger_alloc(dev, "%s-dev%d",
>                                       indio_dev->name, indio_dev->id);
>
>         if (!trig)
> @@ -417,42 +415,42 @@ static int as3935_probe(struct spi_device *spi)
>         iio_trigger_set_drvdata(trig, indio_dev);
>         trig->ops = &iio_interrupt_trigger_ops;
>
> -       ret = devm_iio_trigger_register(&spi->dev, trig);
> +       ret = devm_iio_trigger_register(dev, trig);
>         if (ret) {
> -               dev_err(&spi->dev, "failed to register trigger\n");
> +               dev_err(dev, "failed to register trigger\n");
>                 return ret;
>         }
>
> -       ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev,
> +       ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
>                                               iio_pollfunc_store_time,
>                                               as3935_trigger_handler, NULL);
>
>         if (ret) {
> -               dev_err(&spi->dev, "cannot setup iio trigger\n");
> +               dev_err(dev, "cannot setup iio trigger\n");
>                 return ret;
>         }
>
>         calibrate_as3935(st);
>
>         INIT_DELAYED_WORK(&st->work, as3935_event_work);
> -       ret = devm_add_action(&spi->dev, as3935_stop_work, indio_dev);
> +       ret = devm_add_action(dev, as3935_stop_work, indio_dev);
>         if (ret)
>                 return ret;
>
> -       ret = devm_request_irq(&spi->dev, spi->irq,
> +       ret = devm_request_irq(dev, spi->irq,
>                                 &as3935_interrupt_handler,
>                                 IRQF_TRIGGER_RISING,
> -                               dev_name(&spi->dev),
> +                               dev_name(dev),
>                                 indio_dev);
>
>         if (ret) {
> -               dev_err(&spi->dev, "unable to request irq\n");
> +               dev_err(dev, "unable to request irq\n");
>                 return ret;
>         }
>
> -       ret = devm_iio_device_register(&spi->dev, indio_dev);
> +       ret = devm_iio_device_register(dev, indio_dev);
>         if (ret < 0) {
> -               dev_err(&spi->dev, "unable to register device\n");
> +               dev_err(dev, "unable to register device\n");
>                 return ret;
>         }
>         return 0;
> --
> 2.28.0
>

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

* Re: [PATCH 30/38] iio:humidity:hdc100x: Drop of_match_ptr protection.
  2020-09-10 17:32 ` [PATCH 30/38] iio:humidity:hdc100x: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-15 18:59   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:59 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This prevents use of this driver with ACPI via PRP0001 and is
> an example of an anti pattern I'm trying to remove from IIO.
> Hence drop from this driver.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/humidity/hdc100x.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c
> index 071cb2b12bb6..2a957f19048e 100644
> --- a/drivers/iio/humidity/hdc100x.c
> +++ b/drivers/iio/humidity/hdc100x.c
> @@ -15,6 +15,7 @@
>
>  #include <linux/delay.h>
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/init.h>
>  #include <linux/i2c.h>
>
> @@ -417,7 +418,7 @@ MODULE_DEVICE_TABLE(of, hdc100x_dt_ids);
>  static struct i2c_driver hdc100x_driver = {
>         .driver = {
>                 .name   = "hdc100x",
> -               .of_match_table = of_match_ptr(hdc100x_dt_ids),
> +               .of_match_table = hdc100x_dt_ids,
>         },
>         .probe = hdc100x_probe,
>         .id_table = hdc100x_id,
> --
> 2.28.0
>

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

* Re: [PATCH 16/38] iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 ` [PATCH 16/38] iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-15 18:59   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:59 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This change allows use of this driver with ACPI via PRP0001 and removes
> an example of an anti pattern I'm trying to remove from IIO.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/potentiostat/lmp91000.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> index 67ae635a05f3..f34ca769dc20 100644
> --- a/drivers/iio/potentiostat/lmp91000.c
> +++ b/drivers/iio/potentiostat/lmp91000.c
> @@ -11,7 +11,7 @@
>  #include <linux/module.h>
>  #include <linux/i2c.h>
>  #include <linux/delay.h>
> -#include <linux/of.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/regmap.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/buffer.h>
> @@ -205,13 +205,12 @@ static const struct iio_info lmp91000_info = {
>  static int lmp91000_read_config(struct lmp91000_data *data)
>  {
>         struct device *dev = data->dev;
> -       struct device_node *np = dev->of_node;
>         unsigned int reg, val;
>         int i, ret;
>
> -       ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
> +       ret = device_property_read_u32(dev, "ti,tia-gain-ohm", &val);
>         if (ret) {
> -               if (!of_property_read_bool(np, "ti,external-tia-resistor")) {
> +               if (!device_property_read_bool(dev, "ti,external-tia-resistor")) {
>                         dev_err(dev, "no ti,tia-gain-ohm defined and external resistor not specified\n");
>                         return ret;
>                 }
> @@ -232,7 +231,7 @@ static int lmp91000_read_config(struct lmp91000_data *data)
>                 return ret;
>         }
>
> -       ret = of_property_read_u32(np, "ti,rload-ohm", &val);
> +       ret = device_property_read_u32(dev, "ti,rload-ohm", &val);
>         if (ret) {
>                 val = 100;
>                 dev_info(dev, "no ti,rload-ohm defined, default to %d\n", val);
> @@ -422,7 +421,7 @@ MODULE_DEVICE_TABLE(i2c, lmp91000_id);
>  static struct i2c_driver lmp91000_driver = {
>         .driver = {
>                 .name = LMP91000_DRV_NAME,
> -               .of_match_table = of_match_ptr(lmp91000_of_match),
> +               .of_match_table = lmp91000_of_match,
>         },
>         .probe = lmp91000_probe,
>         .remove = lmp91000_remove,
> --
> 2.28.0
>

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

* Re: [PATCH 25/38] iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 ` [PATCH 25/38] iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-15 18:59   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 18:59 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> of_match_ptr() prevents use of this driver with ACPI via PRP0001 and is
> an example of an anti pattern I'm trying to remove from IIO.
> Hence drop from this driver and use generic fw accessors to check
> if there is a fw_node and get the id.
>
> It might be neater to use pointers rather than indexes for
> the device_data but that is another issue and should be handled
> separately.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/chemical/atlas-sensor.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/chemical/atlas-sensor.c b/drivers/iio/chemical/atlas-sensor.c
> index 43069636fcd5..cdab9d04dedd 100644
> --- a/drivers/iio/chemical/atlas-sensor.c
> +++ b/drivers/iio/chemical/atlas-sensor.c
> @@ -15,7 +15,7 @@
>  #include <linux/irq.h>
>  #include <linux/irq_work.h>
>  #include <linux/i2c.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/regmap.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/buffer.h>
> @@ -620,7 +620,6 @@ static int atlas_probe(struct i2c_client *client,
>  {
>         struct atlas_data *data;
>         struct atlas_device *chip;
> -       const struct of_device_id *of_id;
>         struct iio_trigger *trig;
>         struct iio_dev *indio_dev;
>         int ret;
> @@ -629,11 +628,10 @@ static int atlas_probe(struct i2c_client *client,
>         if (!indio_dev)
>                 return -ENOMEM;
>
> -       of_id = of_match_device(atlas_dt_ids, &client->dev);
> -       if (!of_id)
> +       if (!dev_fwnode(&client->dev))
>                 chip = &atlas_devices[id->driver_data];
>         else
> -               chip = &atlas_devices[(unsigned long)of_id->data];
> +               chip = &atlas_devices[(unsigned long)device_get_match_data(&client->dev)];
>
>         indio_dev->info = &atlas_info;
>         indio_dev->name = ATLAS_DRV_NAME;
> @@ -775,7 +773,7 @@ static const struct dev_pm_ops atlas_pm_ops = {
>  static struct i2c_driver atlas_driver = {
>         .driver = {
>                 .name   = ATLAS_DRV_NAME,
> -               .of_match_table = of_match_ptr(atlas_dt_ids),
> +               .of_match_table = atlas_dt_ids,
>                 .pm     = &atlas_pm_ops,
>         },
>         .probe          = atlas_probe,
> --
> 2.28.0
>

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

* Re: [PATCH 28/38] iio:chemical:vz89x: Introduce local struct device pointer.
  2020-09-10 17:32 ` [PATCH 28/38] iio:chemical:vz89x: Introduce local struct device pointer Jonathan Cameron
@ 2020-09-15 19:02   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 19:02 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Avoids lots of repition of &client->dev and will make the next
> patch tidier.

Typo of repetition.

>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/chemical/vz89x.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
> index 5586eb8e12cd..3cd469578590 100644
> --- a/drivers/iio/chemical/vz89x.c
> +++ b/drivers/iio/chemical/vz89x.c
> @@ -352,12 +352,13 @@ MODULE_DEVICE_TABLE(of, vz89x_dt_ids);
>  static int vz89x_probe(struct i2c_client *client,
>                        const struct i2c_device_id *id)
>  {
> +       struct device *dev = &client->dev;
>         struct iio_dev *indio_dev;
>         struct vz89x_data *data;
>         const struct of_device_id *of_id;
>         int chip_id;
>
> -       indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
> +       indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
>         if (!indio_dev)
>                 return -ENOMEM;
>         data = iio_priv(indio_dev);
> @@ -370,7 +371,7 @@ static int vz89x_probe(struct i2c_client *client,
>         else
>                 return -EOPNOTSUPP;
>
> -       of_id = of_match_device(vz89x_dt_ids, &client->dev);
> +       of_id = of_match_device(vz89x_dt_ids, dev);
>         if (!of_id)
>                 chip_id = id->driver_data;
>         else
> @@ -383,13 +384,13 @@ static int vz89x_probe(struct i2c_client *client,
>         mutex_init(&data->lock);
>
>         indio_dev->info = &vz89x_info;
> -       indio_dev->name = dev_name(&client->dev);
> +       indio_dev->name = dev_name(dev);
>         indio_dev->modes = INDIO_DIRECT_MODE;
>
>         indio_dev->channels = data->chip->channels;
>         indio_dev->num_channels = data->chip->num_channels;
>
> -       return devm_iio_device_register(&client->dev, indio_dev);
> +       return devm_iio_device_register(dev, indio_dev);
>  }
>
>  static const struct i2c_device_id vz89x_id[] = {
> --
> 2.28.0
>

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

* Re: [PATCH 29/38] iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors
  2020-09-10 17:32 ` [PATCH 29/38] iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors Jonathan Cameron
@ 2020-09-15 19:03   ` Matt Ranostay
  0 siblings, 0 replies; 55+ messages in thread
From: Matt Ranostay @ 2020-09-15 19:03 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: open list:IIO SUBSYSTEM AND DRIVERS, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 10:35 AM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This change allow the driver to be used with ACPI PRP0001 and removes
> an antipattern that I want to avoid being copied into new IIO drivers.
>
> The handling of match_data uses a different approach as
> device_get_match_data() doesn't distinguish between no match, and
> a match but with NULL data.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

> ---
>  drivers/iio/chemical/vz89x.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
> index 3cd469578590..23b22a5f5c1c 100644
> --- a/drivers/iio/chemical/vz89x.c
> +++ b/drivers/iio/chemical/vz89x.c
> @@ -10,8 +10,7 @@
>  #include <linux/mutex.h>
>  #include <linux/init.h>
>  #include <linux/i2c.h>
> -#include <linux/of.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> @@ -355,7 +354,6 @@ static int vz89x_probe(struct i2c_client *client,
>         struct device *dev = &client->dev;
>         struct iio_dev *indio_dev;
>         struct vz89x_data *data;
> -       const struct of_device_id *of_id;
>         int chip_id;
>
>         indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
> @@ -371,11 +369,10 @@ static int vz89x_probe(struct i2c_client *client,
>         else
>                 return -EOPNOTSUPP;
>
> -       of_id = of_match_device(vz89x_dt_ids, dev);
> -       if (!of_id)
> +       if (!dev_fwnode(dev))
>                 chip_id = id->driver_data;
>         else
> -               chip_id = (unsigned long)of_id->data;
> +               chip_id = (unsigned long)device_get_match_data(dev);
>
>         i2c_set_clientdata(client, indio_dev);
>         data->client = client;
> @@ -403,7 +400,7 @@ MODULE_DEVICE_TABLE(i2c, vz89x_id);
>  static struct i2c_driver vz89x_driver = {
>         .driver = {
>                 .name   = "vz89x",
> -               .of_match_table = of_match_ptr(vz89x_dt_ids),
> +               .of_match_table = vz89x_dt_ids,
>         },
>         .probe = vz89x_probe,
>         .id_table = vz89x_id,
> --
> 2.28.0
>

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

* Re: [PATCH 00/38] iio: remaining easy of_match_ptr removal and related.
  2020-09-14  8:04 ` [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Andy Shevchenko
@ 2020-09-17 18:17   ` Jonathan Cameron
  0 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2020-09-17 18:17 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-iio, Jonathan Cameron, Matt Ranostay

On Mon, 14 Sep 2020 11:04:43 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Thu, Sep 10, 2020 at 8:35 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > This bumper set removes all the remaining cases where of_match_ptr
> > is mostly serving to prevent use of the device via ACPI PRP0001 and
> > complicating the code. The main aim of this set is to reduce the chances
> > of it being used in future drivers.
> > It also includes some related refactorings, use of generic fw accessors,
> > dropping of CONFIG_OF and lots of header changes inline with the above.
> >
> > For examples of how to use PRP0001 see https://github.com/westeri/meta-acpi
> > which is an excellent resource from which to copy snippets of DSDT tables.
> >
> > It may well not be worth changing the remaining 10 IIO drivers and I
> > certainly don't plan to do so anytime soon.
> >  
> 
> I briefly looked at the series and didn't see anything wrong with it
> (esp. taking into consideration that you are already familiar with the
> topic).
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Thanks Andy + others that reviewed.  I've fixed the typo's in descriptions Matt
highlighted and applied the lot.

If anyone want to add tags, it will be a few days before I push this out
as a non rebasing tree.

Thanks,

Jonathan

> 
> > Jonathan Cameron (38):
> >   iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections.
> >   iio:potentiometer:ds1803: Drop of_match_ptr and CONFIG_OF protections
> >   iio:potentiometer:max5432: Drop of_match_ptr and use generic fw
> >     accessors
> >   iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF
> >     protections.
> >   iio:potentiometer:max5481: Drop invalid ACPI binding.
> >   iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF
> >     protections.
> >   iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw
> >     interfaces.
> >   iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF
> >     protections.
> >   iio:dac:ad5446: Drop of_match_ptr and CONFIG_OF protections
> >   iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections.
> >   iio:dac:ad5593r: Drop of_match_ptr and ACPI_PTR protections.
> >   iio:dac:ad7303: Drop of_match_ptr protection
> >   iio:dac:mcp4725: drop of_match_ptr and use generic fw properties
> >   iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections
> >   iio:dac:ti-dac5571: Drop of_match_ptr and CONFIG_OF protections
> >   iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw
> >     accessors
> >   iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections
> >   iio:pressure:ms5611: Drop of_match_ptr and CONFIG_OF protections
> >   iio:pressure:ms5637: Drop of_match_ptr protection
> >   iio:pressure:zpa2326: Drop of_match_ptr protection
> >   iio:temperature:tsys01: Drop of_match_ptr protection
> >   iio:temperature:tmp007: Drop of_match_ptr protection
> >   iio:resolver:ad2s1200: Drop of_match_ptr protection
> >   iio:chemical:ams-iaq-core: Drop of_match_ptr protection
> >   iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw
> >     accessors
> >   iio:chemical:sgp30: Use local variable dev to simplify code
> >   iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors
> >   iio:chemical:vz89x: Introduce local struct device pointer.
> >   iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw
> >     accessors
> >   iio:humidity:hdc100x: Drop of_match_ptr protection.
> >   iio:proximity:as3935: Use local struct device pointer to simplify
> >     code.
> >   iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors
> >   iio:proximity:pulsedlight: Drop of_match_ptr protection
> >   iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections.
> >   iio:magn:ak8974: Drop of_match_ptr protection
> >   iio:humidity:htu21: Drop of_match_ptr protection
> >   iio:humidity:si7020: Drop of_match_ptr protection
> >   iio:health:max30102: Drop of_match_ptr and use generic fw accessors
> >
> >  drivers/iio/chemical/ams-iaq-core.c           |  3 +-
> >  drivers/iio/chemical/atlas-sensor.c           | 10 ++---
> >  drivers/iio/chemical/sgp30.c                  | 28 ++++++------
> >  drivers/iio/chemical/vz89x.c                  | 18 ++++----
> >  drivers/iio/dac/ad5446.c                      |  5 +--
> >  drivers/iio/dac/ad5592r.c                     |  7 ++-
> >  drivers/iio/dac/ad5593r.c                     |  7 ++-
> >  drivers/iio/dac/ad7303.c                      |  3 +-
> >  drivers/iio/dac/mcp4725.c                     | 29 +++---------
> >  drivers/iio/dac/ti-dac082s085.c               |  5 +--
> >  drivers/iio/dac/ti-dac5571.c                  |  7 +--
> >  drivers/iio/health/max30102.c                 | 11 +++--
> >  drivers/iio/humidity/hdc100x.c                |  3 +-
> >  drivers/iio/humidity/htu21.c                  |  3 +-
> >  drivers/iio/humidity/si7020.c                 |  3 +-
> >  drivers/iio/magnetometer/ak8974.c             |  3 +-
> >  drivers/iio/magnetometer/ak8975.c             |  8 ++--
> >  drivers/iio/potentiometer/ad5272.c            |  5 +--
> >  drivers/iio/potentiometer/ds1803.c            |  6 +--
> >  drivers/iio/potentiometer/max5432.c           |  8 ++--
> >  drivers/iio/potentiometer/max5481.c           | 23 ++--------
> >  drivers/iio/potentiometer/mcp4018.c           | 12 ++---
> >  drivers/iio/potentiometer/mcp4131.c           |  8 ++--
> >  drivers/iio/potentiometer/mcp4531.c           | 11 ++---
> >  drivers/iio/potentiostat/lmp91000.c           | 11 +++--
> >  drivers/iio/pressure/icp10100.c               |  3 +-
> >  drivers/iio/pressure/ms5611_i2c.c             |  6 +--
> >  drivers/iio/pressure/ms5611_spi.c             |  6 +--
> >  drivers/iio/pressure/ms5637.c                 |  3 +-
> >  drivers/iio/pressure/zpa2326_i2c.c            |  6 +--
> >  drivers/iio/pressure/zpa2326_spi.c            |  6 +--
> >  drivers/iio/proximity/as3935.c                | 44 +++++++++----------
> >  .../iio/proximity/pulsedlight-lidar-lite-v2.c |  3 +-
> >  drivers/iio/resolver/ad2s1200.c               |  3 +-
> >  drivers/iio/temperature/tmp007.c              |  4 +-
> >  drivers/iio/temperature/tsys01.c              |  3 +-
> >  36 files changed, 134 insertions(+), 190 deletions(-)
> >
> > --
> > 2.28.0
> >  
> 
> 


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

* Re: [PATCH 03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors
  2020-09-10 17:32 ` [PATCH 03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
@ 2020-09-21 14:24   ` Martin Kaiser
  0 siblings, 0 replies; 55+ messages in thread
From: Martin Kaiser @ 2020-09-21 14:24 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Andy Shevchenko, Jonathan Cameron

Thus wrote Jonathan Cameron (jic23@kernel.org):

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> These prevent use of this driver with ACPI via PRP0001 and are
> an example of an anti pattern I'm trying to remove from IIO.
> Drop them to remove this restriction.

> Also switch headers to reflect this change.

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/iio/potentiometer/max5432.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

> diff --git a/drivers/iio/potentiometer/max5432.c b/drivers/iio/potentiometer/max5432.c
> index 280de9c54471..aed3b6ab82a2 100644
> --- a/drivers/iio/potentiometer/max5432.c
> +++ b/drivers/iio/potentiometer/max5432.c
> @@ -11,8 +11,8 @@
>  #include <linux/iio/iio.h>
>  #include <linux/limits.h>
>  #include <linux/module.h>
> -#include <linux/of.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/property.h>

>  /* All chip variants have 32 wiper positions. */
>  #define MAX5432_MAX_POS 31
> @@ -100,7 +100,7 @@ static int max5432_probe(struct i2c_client *client,

>  	data = iio_priv(indio_dev);
>  	data->client = client;
> -	data->ohm = (unsigned long)of_device_get_match_data(dev);
> +	data->ohm = (unsigned long)device_get_match_data(dev);

>  	indio_dev->info = &max5432_info;
>  	indio_dev->channels = max5432_channels;
> @@ -122,7 +122,7 @@ MODULE_DEVICE_TABLE(of, max5432_dt_ids);
>  static struct i2c_driver max5432_driver = {
>  	.driver = {
>  		.name = "max5432",
> -		.of_match_table = of_match_ptr(max5432_dt_ids),
> +		.of_match_table = max5432_dt_ids,
>  	},
>  	.probe = max5432_probe,
>  };
> -- 
> 2.28.0

Looks good to me.

Reviewed-by: Martin Kaiser <martin@kaiser.cx>

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

* Re: [PATCH 35/38] iio:magn:ak8974: Drop of_match_ptr protection
  2020-09-10 17:32 ` [PATCH 35/38] iio:magn:ak8974: Drop of_match_ptr protection Jonathan Cameron
@ 2020-09-29 12:40   ` Linus Walleij
  0 siblings, 0 replies; 55+ messages in thread
From: Linus Walleij @ 2020-09-29 12:40 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Andy Shevchenko, Jonathan Cameron

On Thu, Sep 10, 2020 at 7:36 PM Jonathan Cameron <jic23@kernel.org> wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> This prevents use of this driver with ACPI via PRP0001 and is
> an example of an anti pattern I'm trying to remove from IIO.
> Hence drop from this driver.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2020-09-29 12:40 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 17:32 [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Jonathan Cameron
2020-09-10 17:32 ` [PATCH 01/38] iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
2020-09-10 17:32 ` [PATCH 02/38] iio:potentiometer:ds1803: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
2020-09-21 14:24   ` Martin Kaiser
2020-09-10 17:32 ` [PATCH 04/38] iio:potentiometer:max5481: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
2020-09-10 17:32 ` [PATCH 05/38] iio:potentiometer:max5481: Drop invalid ACPI binding Jonathan Cameron
2020-09-14  8:07   ` Andy Shevchenko
2020-09-10 17:32 ` [PATCH 06/38] iio:potentiometer:mcp4018: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
2020-09-10 17:32 ` [PATCH 07/38] iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces Jonathan Cameron
2020-09-10 17:32 ` [PATCH 08/38] iio:potentiometer:mcp4531: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
2020-09-10 17:32 ` [PATCH 09/38] iio:dac:ad5446: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 10/38] iio:dac:ad5592r: Drop of_match_ptr and ACPI_PTR protections Jonathan Cameron
2020-09-10 17:32 ` [PATCH 11/38] iio:dac:ad5593r: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 12/38] iio:dac:ad7303: Drop of_match_ptr protection Jonathan Cameron
2020-09-10 17:32 ` [PATCH 13/38] iio:dac:mcp4725: drop of_match_ptr and use generic fw properties Jonathan Cameron
2020-09-10 17:32 ` [PATCH 14/38] iio:dac:ti-dac082s085: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
2020-09-10 17:32 ` [PATCH 15/38] iio:dac:ti-dac5571: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 16/38] iio:potentiostat:lmp91000: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
2020-09-15 18:59   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 17/38] iio:pressure:icp10100: Drop of_match_ptr and CONFIG_OF protections Jonathan Cameron
2020-09-10 17:32 ` [PATCH 18/38] iio:pressure:ms5611: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 19/38] iio:pressure:ms5637: Drop of_match_ptr protection Jonathan Cameron
2020-09-10 17:32 ` [PATCH 20/38] iio:pressure:zpa2326: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 21/38] iio:temperature:tsys01: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 22/38] iio:temperature:tmp007: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 23/38] iio:resolver:ad2s1200: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 24/38] iio:chemical:ams-iaq-core: " Jonathan Cameron
2020-09-15 18:55   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 25/38] iio:chemical:atlas-sensor: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
2020-09-15 18:59   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 26/38] iio:chemical:sgp30: Use local variable dev to simplify code Jonathan Cameron
2020-09-10 17:32 ` [PATCH 27/38] iio:chemical:sgp30: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
2020-09-10 17:32 ` [PATCH 28/38] iio:chemical:vz89x: Introduce local struct device pointer Jonathan Cameron
2020-09-15 19:02   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 29/38] iio:chemical:vz89x: Drop of_match_ptr protection and use generic fw accessors Jonathan Cameron
2020-09-15 19:03   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 30/38] iio:humidity:hdc100x: Drop of_match_ptr protection Jonathan Cameron
2020-09-15 18:59   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 31/38] iio:proximity:as3935: Use local struct device pointer to simplify code Jonathan Cameron
2020-09-15 18:56   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 32/38] iio:proximity:as3935: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
2020-09-15 18:55   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 33/38] iio:proximity:pulsedlight: Drop of_match_ptr protection Jonathan Cameron
2020-09-15 18:55   ` Matt Ranostay
2020-09-10 17:32 ` [PATCH 34/38] iio:magn:ak8975: Drop of_match_ptr and ACPI_PTR protections Jonathan Cameron
2020-09-11 18:59   ` Jonathan Albrieux
2020-09-10 17:32 ` [PATCH 35/38] iio:magn:ak8974: Drop of_match_ptr protection Jonathan Cameron
2020-09-29 12:40   ` Linus Walleij
2020-09-10 17:32 ` [PATCH 36/38] iio:humidity:htu21: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 37/38] iio:humidity:si7020: " Jonathan Cameron
2020-09-10 17:32 ` [PATCH 38/38] iio:health:max30102: Drop of_match_ptr and use generic fw accessors Jonathan Cameron
2020-09-15 18:54   ` Matt Ranostay
2020-09-14  8:04 ` [PATCH 00/38] iio: remaining easy of_match_ptr removal and related Andy Shevchenko
2020-09-17 18:17   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).