Skip to contentSkip to conversation

IIO: Drop incorrect includes of linux/of.h

PATCH In review Jonathan Cameron 3 participants 12 messages Feb 18, 2024 – Feb 24, 2024

Subsystems (4)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover IIO: Drop incorrect includes of linux/of.h

From: Jonathan Cameron <[email protected]>

These were false positives when I was looking at which drivers should be converted over to fwnode based handling from linux/property.h

None of them use anything defined in linux/of.h, so drop the include and include more specific headers (mostly linux/mod_devicetable.h) instead.

Jonathan Cameron (8):
iio: light: vl6180: Drop unused linux/of.h include
iio: light: al3320a: Drop unused linux/of.h include
iio: light: al3010: Switch from linux/of.h to linux/mod_devicetable.h
iio: adc: ads8688: Switch to mod_devicetable.h for struct of_device_id
definition
iio: accel: adxl372: Switch from linux/of.h to linux/mod_devicetable.h
iio: accel: bma180: Switch from linux/of.h to linux/mod_devicetable.h
iio: accel: kxsd9: Switch from linux/of.h to linux/mod_devicetable.h
iio: dac: mcp4821: Switch to including mod_devicetable.h for struct
of_device_id definition.

 drivers/iio/accel/adxl372_spi.c | 2 +-
 drivers/iio/accel/bma180.c      | 2 +-
 drivers/iio/accel/kxsd9-spi.c   | 2 +-
 drivers/iio/adc/ti-ads8688.c    | 2 +-
 drivers/iio/dac/mcp4821.c       | 2 +-
 drivers/iio/light/al3010.c      | 2 +-
 drivers/iio/light/al3320a.c     | 1 -
 drivers/iio/light/vl6180.c      | 1 -
 8 files changed, 6 insertions(+), 8 deletions(-)
Signature · 1 line
2.43.2
author maintainer
#1 lore raw

PATCH 1/8 iio: light: vl6180: Drop unused linux/of.h include

From: Jonathan Cameron <[email protected]>

Nothing from linux/of.h is used in this driver.

---
 drivers/iio/light/vl6180.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/light/vl6180.c +0 -1
index d4948dfc31ff..dcadf6428a87 100644
@@ -20,7 +20,6 @@
 #include <linux/i2c.h>
 #include <linux/mutex.h>
 #include <linux/err.h>
-#include <linux/of.h>
 #include <linux/delay.h>
 #include <linux/util_macros.h>
 
Signature · 1 line
2.43.2
author maintainer
#2 lore raw

PATCH 2/8 iio: light: al3320a: Drop unused linux/of.h include

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Nothing from linux/of.h used in this driver.

---
 drivers/iio/light/al3320a.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/light/al3320a.c +0 -1
index d5957d85c278..105f379b9b41 100644
@@ -15,7 +15,6 @@
 #include <linux/bitfield.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/mod_devicetable.h>
 
 #include <linux/iio/iio.h>
Signature · 1 line
2.43.2
author maintainer
#3 lore raw

PATCH 3/8 iio: light: al3010: Switch from linux/of.h to linux/mod_devicetable.h

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The only of specific definition used is of_device_id table and that is found in mod_devicetable.h not of.h

---
 drivers/iio/light/al3010.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/al3010.c +1 -1
index 8f0119f392b7..53569587ccb7 100644
@@ -17,7 +17,7 @@
 #include <linux/bitfield.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
Signature · 1 line
2.43.2
author maintainer
#4 lore raw

PATCH 4/8 iio: adc: ads8688: Switch to mod_devicetable.h for struct of_device_id definition

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

of.h was only included to get access to this structure, so include the correct header directly instead.

---
 drivers/iio/adc/ti-ads8688.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads8688.c +1 -1
index ef06a897421a..9440a268a78c 100644
@@ -11,7 +11,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/err.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/buffer.h>
Signature · 1 line
2.43.2
author maintainer
#5 lore raw

PATCH 5/8 iio: accel: adxl372: Switch from linux/of.h to linux/mod_devicetable.h

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The only of specific definition used is of_device_id table and that is found in mod_devicetable.h not of.h

---
 drivers/iio/accel/adxl372_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl372_spi.c +1 -1
index 75a88f16c6c9..787699773f96 100644
@@ -6,8 +6,8 @@
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regmap.h>
-#include <linux/of.h>
 #include <linux/spi/spi.h>
 
 #include "adxl372.h"
Signature · 1 line
2.43.2
author maintainer
#6 lore raw

PATCH 6/8 iio: accel: bma180: Switch from linux/of.h to linux/mod_devicetable.h

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The only of specific definition used is of_device_id table and that is found in mod_devicetable.h not of.h

---
 drivers/iio/accel/bma180.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/bma180.c +1 -1
index ab4fccb24b6c..6581772cb0c4 100644
@@ -13,10 +13,10 @@
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
-#include <linux/of.h>
 #include <linux/bitops.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
Signature · 1 line
2.43.2
author maintainer
#7 lore raw

PATCH 7/8 iio: accel: kxsd9: Switch from linux/of.h to linux/mod_devicetable.h

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The only of specific definition used is of_device_id table and that is found in mod_devicetable.h not of.h

---
 drivers/iio/accel/kxsd9-spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/kxsd9-spi.c +1 -1
index 1719a9f1d90a..4414670dfb43 100644
@@ -1,9 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <linux/device.h>
 #include <linux/kernel.h>
-#include <linux/of.h>
 #include <linux/spi/spi.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/slab.h>
 #include <linux/regmap.h>
 
Signature · 1 line
2.43.2
author maintainer
#8 lore raw

PATCH 8/8 iio: dac: mcp4821: Switch to including mod_devicetable.h for struct of_device_id definition.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

of.h was only included for this definition, so include the correct header instead.

---
 drivers/iio/dac/mcp4821.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/mcp4821.c +1 -1
index 8a0480d33845..782e8f6b7782 100644
@@ -17,7 +17,7 @@
  */
 
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
 
 #include <linux/iio/iio.h>
Signature · 1 line
2.43.2
Reviewed-by Nuno Sa on the v1 series
#9 lore raw
In reply to Jonathan Cameron
Quoted 30 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

These were false positives when I was looking at which drivers should be converted over to fwnode based handling from linux/property.h

None of them use anything defined in linux/of.h, so drop the include and include more specific headers (mostly linux/mod_devicetable.h) instead.

Jonathan Cameron (8):
  iio: light: vl6180: Drop unused linux/of.h include
  iio: light: al3320a: Drop unused linux/of.h include
  iio: light: al3010: Switch from linux/of.h to linux/mod_devicetable.h
  iio: adc: ads8688: Switch to mod_devicetable.h for struct of_device_id definition
  iio: accel: adxl372: Switch from linux/of.h to linux/mod_devicetable.h
  iio: accel: bma180: Switch from linux/of.h to linux/mod_devicetable.h
  iio: accel: kxsd9: Switch from linux/of.h to linux/mod_devicetable.h
  iio: dac: mcp4821: Switch to including mod_devicetable.h for struct of_device_id definition.

 drivers/iio/accel/adxl372_spi.c | 2 +-
 drivers/iio/accel/bma180.c      | 2 +-
 drivers/iio/accel/kxsd9-spi.c   | 2 +-
 drivers/iio/adc/ti-ads8688.c    | 2 +-
 drivers/iio/dac/mcp4821.c       | 2 +-
 drivers/iio/light/al3010.c      | 2 +-
 drivers/iio/light/al3320a.c     | 1 -
 drivers/iio/light/vl6180.c      | 1 -

Quoted 2 lines
 8 files changed, 6 insertions(+), 8 deletions(-)
Reviewed-by on the v1 series
#10 lore raw
In reply to Jonathan Cameron
Quoted 9 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

These were false positives when I was looking at which drivers should be converted over to fwnode based handling from linux/property.h

None of them use anything defined in linux/of.h, so drop the include and include more specific headers (mostly linux/mod_devicetable.h) instead.

Simple and important one (makes me not look into unrelated code),

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer Applied
#11 lore raw
Quoted 7 lines · On Mon, 19 Feb 2024 14:24:29 +0200 Andy Shevchenko…
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

These were false positives when I was looking at which drivers should be converted over to fwnode based handling from linux/property.h

Quoted 7 lines
Quoted 3 lines

None of them use anything defined in linux/of.h, so drop the include and include more specific headers (mostly linux/mod_devicetable.h) instead.

Simple and important one (makes me not look into unrelated code),

Applied.