Skip to contentSkip to conversation

iio: temperature: make headers conform to IWYU

PATCH Superseded Joshua Crofts 2 participants 18 messages Aug 29

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover iio: temperature: make headers conform to IWYU

This series removes any instances of kernel.h in the temperature/ subdirectory and cleans up the headers in order to improve readability and enforce IYWU instead of relying on transitive dependencies during the build process.

I had Gemini generate a summary (a bit more verbose) of changed headers under the --- in each IWYU patch to improve the review process.

This is part of an ongoing effort to remove kernel.h entirely from IIO.

---
Changes in v2:
- Add missing headers pointed out by Sashiko.
- Swap <asm/div64.h> for <linux/math64.h> (Jonathan, Andy).
- Squash small reordering patches with iwyu changes.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Joshua Crofts (11):
iio: temperature: iqs620at-temp: make headers conform to IWYU
iio: temperature: ltc2983: reorder headers
iio: temperature: ltc2983: make headers conform to IWYU
iio: temperature: mlx90632: make headers conform to IWYU
iio: temperature: mlx90635: make headers conform to IWYU
iio: temperature: tmp117: sort headers alphabetically
iio: temperature: tmp117: make headers conform to IWYU
iio: temperature: tsys01: reorder headers
iio: temperature: tsys01: make headers conform to IWYU
iio: temperature: tsys02d: reorder headers
iio: temperature: tsys02d: make headers conform to IWYU

 drivers/iio/temperature/iqs620at-temp.c |  9 +++++++--
 drivers/iio/temperature/ltc2983.c       | 15 +++++++++++----
 drivers/iio/temperature/mlx90632.c      | 10 +++++++---
 drivers/iio/temperature/mlx90635.c      | 11 +++++++----
 drivers/iio/temperature/tmp117.c        | 10 +++++-----
 drivers/iio/temperature/tsys01.c        | 16 ++++++++++------
 drivers/iio/temperature/tsys02d.c       | 11 ++++++++---
 7 files changed, 55 insertions(+), 27 deletions(-)

---
base-commit: 350d1fb9204b13c5f95e511e98b8bcb47574d425
change-id: 20260821-kernel-header-removal-d95efd197d78

Best regards,

Signature · 2 lines
Kind regards,
Joshua Crofts
#1 lore raw

PATCH v2 1/11 iio: temperature: iqs620at-temp: make headers conform to IWYU

Remove the catch-all kernel.h header and add the missing headers to enforce IWYU.

Additionally, separate the IIO specific header from the generic <linux/*> headers.

---
Header changes explained:
Added:
- <asm/byteorder.h>: for endianness helpers
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.) Removed:
- <linux/kernel.h>: catch-all header no longer needed

---
 drivers/iio/temperature/iqs620at-temp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/iio/temperature/iqs620at-temp.c +7 -2
index e2f878d57af7..3a3b1f256585 100644
@@ -5,13 +5,18 @@
  * Copyright (C) 2019 Jeff LaBundy <[email protected]>
  */
 
+#include <linux/array_size.h>
+#include <linux/bits.h>
 #include <linux/device.h>
-#include <linux/iio/iio.h>
-#include <linux/kernel.h>
 #include <linux/mfd/iqs62x.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
+#include <linux/types.h>
+
+#include <asm/byteorder.h>
+
+#include <linux/iio/iio.h>
 
 #define IQS620_TEMP_UI_OUT			0x1A
 
Signature · 1 line
2.55.0
#2 lore raw

PATCH v2 2/11 iio: temperature: ltc2983: reorder headers

In reply to Joshua Crofts

Separate the IIO specific header and group unaligned.h with the other generic <linux/*> headers.

No functional change.

---
 drivers/iio/temperature/ltc2983.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/iio/temperature/ltc2983.c +3 -2
index 6efb5252a773..fe9eec3058d4 100644
@@ -11,7 +11,6 @@
 #include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
-#include <linux/iio/iio.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
 #include <linux/module.h>
@@ -19,9 +18,11 @@
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/spi/spi.h>
+#include <linux/unaligned.h>
 
 #include <asm/byteorder.h>
-#include <linux/unaligned.h>
+
+#include <linux/iio/iio.h>
 
 /* register map */
 #define LTC2983_STATUS_REG			0x0000
Signature · 1 line
2.55.0
#3 lore raw

PATCH v2 3/11 iio: temperature: ltc2983: make headers conform to IWYU

In reply to Joshua Crofts

Remove the catch-all kernel.h header and add the missing headers to enforce IWYU.

---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bitops.h>: for bitwise operations
- <linux/container_of.h>: for container_of macro
- <linux/dev_printk.h>: for dev_err(), dev_info(), etc.
- <linux/math64.h>: for div64 functions
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/slab.h>: for memory allocation
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.) Removed:
- <linux/errno.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed

---
 drivers/iio/temperature/ltc2983.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/iio/temperature/ltc2983.c +9 -2
index fe9eec3058d4..b8deb9aa9d48 100644
@@ -5,19 +5,26 @@
  *
  * Copyright 2019 Analog Devices Inc.
  */
+
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bitops.h>
 #include <linux/completion.h>
+#include <linux/container_of.h>
+#include <linux/dev_printk.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
+#include <linux/math64.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/slab.h>
 #include <linux/spi/spi.h>
+#include <linux/types.h>
 #include <linux/unaligned.h>
 
 #include <asm/byteorder.h>
Signature · 1 line
2.55.0
#7 lore raw

PATCH v2 4/11 iio: temperature: mlx90632: make headers conform to IWYU

In reply to Joshua Crofts

Remove the catch-all kernel.h header and add the missing headers to enforce IWYU.

Additionally, sort the entries alphabetically.

---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/dev_printk.h>: for dev_err(), dev_info(), etc.
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.) Removed:
- <linux/gpio/consumer.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed

---
 drivers/iio/temperature/mlx90632.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/iio/temperature/mlx90632.c +7 -3
index 2fde48f337e2..74ae36f74e8b 100644
@@ -6,21 +6,25 @@
  *
  * Driver for the Melexis MLX90632 I2C 16-bit IR thermopile sensor
  */
+
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bits.h>
 #include <linux/delay.h>
+#include <linux/dev_printk.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/iopoll.h>
 #include <linux/jiffies.h>
-#include <linux/kernel.h>
 #include <linux/limits.h>
-#include <linux/module.h>
 #include <linux/math64.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
Signature · 1 line
2.55.0
#8 lore raw

PATCH v2 5/11 iio: temperature: mlx90635: make headers conform to IWYU

In reply to Joshua Crofts

Remove the catch-all kernel.h header and add the missing headers to enforce IWYU.

Additionally, sort the headers alphabetically.

---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/dev_printk.h>: for dev_err(), dev_info(), etc.
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.) Removed:
- <linux/gpio/consumer.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
- <linux/limits.h>: not directly used in this driver

---
 drivers/iio/temperature/mlx90635.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/iio/temperature/mlx90635.c +7 -4
index 0f31879a4f64..48c760c980f3 100644
@@ -6,21 +6,24 @@
  *
  * Driver for the Melexis MLX90635 I2C 16-bit IR thermopile sensor
  */
+
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bits.h>
 #include <linux/delay.h>
+#include <linux/dev_printk.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/iopoll.h>
 #include <linux/jiffies.h>
-#include <linux/kernel.h>
-#include <linux/limits.h>
-#include <linux/module.h>
 #include <linux/math64.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 
Signature · 1 line
2.55.0
#9 lore raw

PATCH v2 6/11 iio: temperature: tmp117: sort headers alphabetically

In reply to Joshua Crofts

Sort the headers alphabetically to improve readability.

No functional change.

---
 drivers/iio/temperature/tmp117.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/temperature/tmp117.c +3 -3
index 74cb8d62bef3..fed8af2d81eb 100644
@@ -10,16 +10,16 @@
  */
 
 #include <linux/array_size.h>
+#include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
-#include <linux/module.h>
-#include <linux/bitops.h>
-#include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/limits.h>
+#include <linux/module.h>
 #include <linux/property.h>
 #include <linux/regulator/consumer.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 
Signature · 1 line
2.55.0
#10 lore raw

PATCH v2 7/11 iio: temperature: tmp117: make headers conform to IWYU

In reply to Joshua Crofts

Remove the catch-all kernel.h header and add the missing <linux/dev_printk.h> header to enforce IWYU.

---
Header changes explained:
Added:
- <linux/dev_printk.h>: for dev_err(), dev_info(), etc.
- <linux/minmax.h>: for min/max limit macros Removed:
- <linux/kernel.h>: catch-all header no longer needed

---
 drivers/iio/temperature/tmp117.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/temperature/tmp117.c +2 -1
index fed8af2d81eb..25bc98e64e48 100644
@@ -12,10 +12,11 @@
 #include <linux/array_size.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
+#include <linux/dev_printk.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
-#include <linux/kernel.h>
 #include <linux/limits.h>
+#include <linux/minmax.h>
 #include <linux/module.h>
 #include <linux/property.h>
 #include <linux/regulator/consumer.h>
Signature · 1 line
2.55.0
#11 lore raw

PATCH v2 8/11 iio: temperature: tsys01: reorder headers

In reply to Joshua Crofts

Sort the headers alphabetically and group the IIO headers and vendor specific header separately.

No functional change.

---
 drivers/iio/temperature/tsys01.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/iio/temperature/tsys01.c +6 -4
index 28b3ce022ce7..14de67ee8be7 100644
@@ -8,14 +8,16 @@
  *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
  */
 
-#include <linux/iio/iio.h>
-#include <linux/iio/sysfs.h>
 #include <linux/device.h>
-#include <linux/mutex.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/stat.h>
+
+#include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
+
 #include "../common/ms_sensors/ms_sensors_i2c.h"
 
 /* TSYS01 Commands */
Signature · 1 line
2.55.0
#12 lore raw

PATCH v2 9/11 iio: temperature: tsys01: make headers conform to IWYU

In reply to Joshua Crofts

Remove the catch-all kernel.h header, add missing headers and remove unused headers.

---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/i2c.h>: for i2c_client and i2c_device_id
- <linux/math64.h>: for div64 functions
- <linux/sprintf.h>: for sprintf functions
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.) Removed:
- <linux/init.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed
- <linux/property.h>: not directly used in this driver
- <linux/stat.h>: not directly used in this driver

---
 drivers/iio/temperature/tmp117.c |  3 +--
 drivers/iio/temperature/tsys01.c | 10 ++++++----
 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/iio/temperature/tmp117.c +1 -2
index 25bc98e64e48..96252627613f 100644
@@ -12,13 +12,12 @@
 #include <linux/array_size.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
-#include <linux/dev_printk.h>
+#include <linux/device.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
 #include <linux/limits.h>
 #include <linux/minmax.h>
 #include <linux/module.h>
-#include <linux/property.h>
 #include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
drivers/iio/temperature/tsys01.c +6 -4
index 14de67ee8be7..3c1f5b6ac156 100644
@@ -8,12 +8,14 @@
  *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
  */
 
-#include <linux/device.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
+#include <linux/array_size.h>
+#include <linux/dev_printk.h>
+#include <linux/i2c.h>
+#include <linux/math64.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
-#include <linux/stat.h>
+#include <linux/sprintf.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
Signature · 1 line
2.55.0
#15 lore raw

PATCH v2 10/11 iio: temperature: tsys02d: reorder headers

In reply to Joshua Crofts

Sort the headers alphabetically and group the IIO specific headers separately.

No functional change.

---
 drivers/iio/temperature/tsys02d.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/iio/temperature/tsys02d.c +3 -2
index 3ef72347456e..377e27b45fdd 100644
@@ -10,11 +10,12 @@
  *  http://www.meas-spec.com/downloads/Digital_Sensor_TSYS02D.pdf
  */
 
-#include <linux/init.h>
 #include <linux/device.h>
+#include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/stat.h>
 #include <linux/module.h>
+#include <linux/stat.h>
+
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 
Signature · 1 line
2.55.0
#16 lore raw

PATCH v2 11/11 iio: temperature: tsys02d: make headers conform to IWYU

In reply to Joshua Crofts

Remove the catch-all kernel.h header, add missing headers and remove unused headers.

---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/i2c.h>: for i2c_client and i2c_device_id
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/sysfs.h>: for sysfs API
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.) Removed:
- <linux/init.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed

---
 drivers/iio/temperature/ltc2983.c | 1 -
 drivers/iio/temperature/tsys02d.c | 8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/iio/temperature/ltc2983.c +0 -1
index b8deb9aa9d48..6c4de6854683 100644
@@ -11,7 +11,6 @@
 #include <linux/bitops.h>
 #include <linux/completion.h>
 #include <linux/container_of.h>
-#include <linux/dev_printk.h>
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/interrupt.h>
drivers/iio/temperature/tsys02d.c +6 -2
index 377e27b45fdd..4946d0b14632 100644
@@ -10,11 +10,15 @@
  *  http://www.meas-spec.com/downloads/Digital_Sensor_TSYS02D.pdf
  */
 
+#include <linux/array_size.h>
+#include <linux/bits.h>
 #include <linux/device.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
+#include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/stat.h>
+#include <linux/sysfs.h>
+#include <linux/types.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
Signature · 1 line
2.55.0
#17 lore raw

Re: [PATCH v2 11/11] iio: temperature: tsys02d: make headers conform to IWYU

Quoted 26 lines · On Sat, 29 Aug 2026 18:26:08 +0200 Joshua Crofts <[email protected]>…

Remove the catch-all kernel.h header, add missing headers and remove unused headers.

---
Header changes explained:
Added:
- <linux/array_size.h>: for ARRAY_SIZE()
- <linux/bits.h>: for GENMASK() and BIT() macros
- <linux/i2c.h>: for i2c_client and i2c_device_id
- <linux/mutex.h>: for struct mutex and mutex_lock/unlock
- <linux/sysfs.h>: for sysfs API
- <linux/types.h>: for fixed-width integer types (u8, u16, etc.) Removed:
- <linux/init.h>: not directly used in this driver
- <linux/kernel.h>: catch-all header no longer needed

---
 drivers/iio/temperature/ltc2983.c | 1 -
 drivers/iio/temperature/tsys02d.c | 8 ++++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/iio/temperature/ltc2983.c +0 -0
index b8deb9aa9d48..6c4de6854683 100644

drivers/iio/temperature/ltc2983.c line 14

Quoted 4 lines
drivers/iio/temperature/ltc2983.c +0 -1
@@ -11,7 +11,6 @@
 #include <linux/bitops.h>
 #include <linux/completion.h>
 #include <linux/container_of.h>
-#include <linux/dev_printk.h>

Ugh, how did this stray change get in here? Must've been a bad fixup...

Signature · 2 lines
Kind regards,
Joshua Crofts
maintainer
#4 lore raw

Re: [PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU

In reply to Joshua Crofts
Quoted 2 lines

Remove the catch-all kernel.h header and add the missing headers to enforce IWYU.

Sashiko correctly observed that this wasn't really IWYU. So, to avoid confusion we should be referring to something "approximate IWYU taking into account some headers that always include others".

Quoted 24 lines
drivers/iio/temperature/ltc2983.c +5 -2
index fe9eec3058d4..b8deb9aa9d48 100644
@@ -5,19 +5,26 @@
  *
  * Copyright 2019 Analog Devices Inc.
  */
+
+#include <linux/array_size.h>
 #include <linux/bitfield.h>
+#include <linux/bitops.h>
 #include <linux/completion.h>
+#include <linux/container_of.h>
+#include <linux/dev_printk.h>
 #include <linux/device.h>
 #include <linux/err.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>

drivers/iio/temperature/ltc2983.c line 28

Quoted 10 lines
drivers/iio/temperature/ltc2983.c +4 -0
+#include <linux/math64.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/slab.h>
 #include <linux/spi/spi.h>
+#include <linux/types.h>
 #include <linux/unaligned.h>

There were a few other sashiko comments...

[Severity: Medium]
To fully conform to IWYU, are there other missing headers that should be included here?

For example, __ltc2983_custom_sensor_new() calls strcmp():

if ((index % 2) != 0 && !strcmp(propname, "adi,custom-leak-detector"))
temp = temp * 1000000 + 273150000;

Does this require including <linux/string.h>?

Seems reasonable to me. Why did you not include it?

Similarly, ltc2983_probe() calls devm_gpiod_get_optional() and usleep_range():

gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(gpio))

		return PTR_ERR(gpio);

usleep_range(1000, 1200);

Would including <linux/gpio/consumer.h> and <linux/delay.h> be necessary here?

Both seem reasonable to me.

Also, the ltc2983_pm_ops struct is defined using the DEFINE_SIMPLE_DEV_PM_OPS macro:

static DEFINE_SIMPLE_DEV_PM_OPS(ltc2983_pm_ops, ltc2983_suspend,
ltc2983_resume);

Does this macro require including <linux/pm.h>?

Also seems sensible.

Signature · 1 line
Jonathan Cameron <[email protected]>
maintainer
#13 lore raw

Re: [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU

In reply to Joshua Crofts
Quoted 1 line

Remove the catch-all kernel.h header, add missing headers and remove

Seems some fixups in wrong patch as tmp117 stuff in here.

Sashiko shouted about that.

Quoted 28 lines

unused headers.

drivers/iio/temperature/tmp117.c +1 -2
index 25bc98e64e48..96252627613f 100644
@@ -12,13 +12,12 @@
 #include <linux/array_size.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
-#include <linux/dev_printk.h>
+#include <linux/device.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
 #include <linux/limits.h>
 #include <linux/minmax.h>
 #include <linux/module.h>
-#include <linux/property.h>
 #include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
drivers/iio/temperature/tsys01.c +0 -0
index 14de67ee8be7..3c1f5b6ac156 100644

drivers/iio/temperature/tsys01.c line 11

Quoted 4 lines
drivers/iio/temperature/tsys01.c +0 -1
@@ -8,12 +8,14 @@
  *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
  */
 
-#include <linux/device.h>
 | sashiko.dev <[email protected]>:
 |
 | [Severity: Low]
 | Does removing <linux/device.h> contradict the Include What You Use principles
 | mentioned in the commit message?
 |
 | Looking at tsys01_probe(), it directly dereferences struct device and struct
 | device_driver:
 |
 | tsys01_probe() {
 |     ...
 |     indio_dev->name = dev->driver->name;

Looks valid to me.

| ...
| }

Jonathan

Signature · 1 line
Jonathan Cameron <[email protected]>
#14 lore raw

Re: [PATCH v2 09/11] iio: temperature: tsys01: make headers conform to IWYU

Quoted 5 lines · On Sat, 29 Aug 2026 18:57:39 +0100 Jonathan Cameron <[email protected]> wrote:
Quoted 1 line

Remove the catch-all kernel.h header, add missing headers and remove

Seems some fixups in wrong patch as tmp117 stuff in here.

Sashiko shouted about that.

Yeah, must've been half asleep when I was squashing commits.

Quoted 47 lines
Quoted 29 lines

unused headers.

drivers/iio/temperature/tmp117.c +1 -2
index 25bc98e64e48..96252627613f 100644
@@ -12,13 +12,12 @@
 #include <linux/array_size.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
-#include <linux/dev_printk.h>
+#include <linux/device.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
 #include <linux/limits.h>
 #include <linux/minmax.h>
 #include <linux/module.h>
-#include <linux/property.h>
 #include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
drivers/iio/temperature/tsys01.c +0 -0
index 14de67ee8be7..3c1f5b6ac156 100644

drivers/iio/temperature/tsys01.c line 11

Quoted 4 lines
drivers/iio/temperature/tsys01.c +0 -1
@@ -8,12 +8,14 @@
  *  http://www.meas-spec.com/downloads/TSYS01_Digital_Temperature_Sensor.pdf
  */
 
-#include <linux/device.h>  
 | sashiko.dev <[email protected]>:
 |
 | [Severity: Low]
 | Does removing <linux/device.h> contradict the Include What You Use principles
 | mentioned in the commit message?
 |
 | Looking at tsys01_probe(), it directly dereferences struct device and struct
 | device_driver:
 |
 | tsys01_probe() {
 |     ...
 |     indio_dev->name = dev->driver->name;
Quoted 7 lines

Looks valid to me.

| ...
| }

Jonathan

Yep, all Sashiko issues addressed in my series locally, but I'll let this sit for a while before resending.

Signature · 2 lines
Kind regards,
Joshua Crofts
#5 lore raw

Re: [PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU

In reply to Jonathan Cameron
Quoted 7 lines · Jonathan Cameron
Quoted 3 lines

Remove the catch-all kernel.h header and add the missing headers to enforce IWYU.

Sashiko correctly observed that this wasn't really IWYU. So, to avoid confusion we should be referring to something "approximate IWYU taking into account some headers that always include others".

On another note - since we paste Sashiko outputs regularly into patch reviews, isn't it time to send a pull request to the Sashiko repo to Cc linux-iio on reviews?
I remember the last email thread discussing this died out unfortunately :(

--
Kind regards,
Joshua Crofts

maintainer
#6 lore raw

Re: [PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU

Quoted 5 lines · On Sat, 29 Aug 2026 22:24:47 +0200 Joshua Crofts <[email protected]>…
Quoted 4 lines · Jonathan Cameron
Quoted 3 lines

Remove the catch-all kernel.h header and add the missing headers to enforce IWYU.

Quoted 8 lines
Quoted 3 lines

Sashiko correctly observed that this wasn't really IWYU. So, to avoid confusion we should be referring to something "approximate IWYU taking into account some headers that always include others".

On another note - since we paste Sashiko outputs regularly into patch reviews, isn't it time to send a pull request to the Sashiko repo to Cc linux-iio on reviews?
I remember the last email thread discussing this died out unfortunately :(

Let's pick up on that original thread again rather than buried in here.

There were some valid concerns and there is work more generally going on to solve the new contributor information gap.

Jonathan

Quoted 5 lines

--
Kind regards,
Joshua Crofts