[PATCH v2 03/11] iio: temperature: ltc2983: make headers conform to IWYU
From: Joshua Crofts
Date: Sat Aug 29 2026 - 12:26:20 EST
Remove the catch-all kernel.h header and add the missing headers to
enforce IWYU.
Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
---
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(-)
diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
index fe9eec3058d4..b8deb9aa9d48 100644
--- a/drivers/iio/temperature/ltc2983.c
+++ b/drivers/iio/temperature/ltc2983.c
@@ -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>
--
2.55.0