[PATCH v4 03/11] iio: amplifiers: ad8366: remove unused include headers

Rodrigo Alencar via B4 Relay
2026-02-10T19:42:17Z

From: Rodrigo Alencar <rodrigo.alencar@analog.com>

Apply IWYU principle, removing the following headers:
- linux/device.h: no usage of devm_add_action_or_reset, device_attr...
- linux/kernel.h: no usage of container_of, kasprintf, ...
- linux/slab.h: memory management handled by iio
- linux/sysfs.h: sysfs interaction is managed by iio
- linux/iio/sysfs.h: not using iio device attributes in this driver

Being a small patch, the remaining includes are alphabetically sorted.
In gcc, compiling with -H allows for dependency visualization,
which indicates that except for linux/iio/sysfs.h, all removed
headers are indirectly included by the remaining headers.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
---
drivers/iio/amplifiers/ad8366.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
index d06ac786501c..6382106ee6c7 100644
--- a/drivers/iio/amplifiers/ad8366.c
+++ b/drivers/iio/amplifiers/ad8366.c
@@ -11,19 +11,14 @@
* Copyright 2012-2019 Analog Devices Inc.
*/

-#include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
-#include <linux/spi/spi.h>
-#include <linux/regulator/consumer.h>
-#include <linux/gpio/consumer.h>
-#include <linux/err.h>
-#include <linux/module.h>
#include <linux/bitrev.h>
+#include <linux/err.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/regulator/consumer.h>
+#include <linux/spi/spi.h>

#include <linux/iio/iio.h>
-#include <linux/iio/sysfs.h>

enum ad8366_type {
ID_AD8366,

--
2.43.0