[PATCH v4 2/2] staging: iio: addac: adt7316: replace kernel.h with explicit headers

From: Abdelnasser Hussein

Date: Wed Nov 04 2026 - 15:14:08 EST


Drop the proxy header <linux/kernel.h> and replace it with direct
inclusions per the Include What You Use (IWYU) principle. Also remove
unused headers and keep the list alphabetically sorted.

Reviewed-by: Joshua Crofts <crofts@xxxxxxxxxx>
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@xxxxxxxxx>
---
Headers added:
- <linux/bits.h> for BIT()
- <linux/err.h> for IS_ERR() and PTR_ERR()
- <linux/errno.h> for error codes (-EIO, -EPERM, -EINVAL, -ENOMEM,
-ENODEV)
- <linux/kstrtox.h> for kstrtou8(), kstrtou16() and kstrtoint()
- <linux/pm.h> for EXPORT_GPL_SIMPLE_DEV_PM_OPS()
- <linux/string.h> for memcmp()
- <linux/types.h> for u8, u16, bool and s64

Headers dropped:
- <linux/i2c.h>, <linux/kernel.h>, <linux/list.h>, <linux/rtc.h>,
<linux/slab.h> and <linux/workqueue.h>

Changes in v4:
- Moved the list of added/dropped headers out of the commit message.

drivers/staging/iio/addac/adt7316.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c
index 515f1fdae46b..54d942cae586 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -5,18 +5,19 @@
* Copyright 2010 Analog Devices Inc.
*/

+#include <linux/bits.h>
#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/errno.h>
#include <linux/gpio/consumer.h>
-#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
-#include <linux/kernel.h>
-#include <linux/list.h>
+#include <linux/kstrtox.h>
#include <linux/module.h>
-#include <linux/rtc.h>
-#include <linux/slab.h>
+#include <linux/pm.h>
+#include <linux/string.h>
#include <linux/sysfs.h>
-#include <linux/workqueue.h>
+#include <linux/types.h>

#include <linux/iio/events.h>
#include <linux/iio/iio.h>
--
2.56.0