[PATCH 07/22] iio: dac: ad5686: refactor include headers

Rodrigo Alencar via B4 Relay
2026-04-22T14:46:24Z

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

Apply IWYU principle, replacing unused/generic headers for
specific/missing headers. The resulting include directive list is sorted
accordingly.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
---
drivers/iio/dac/ad5686-spi.c | 8 ++++++--
drivers/iio/dac/ad5686.c | 13 ++++---------
drivers/iio/dac/ad5686.h | 5 ++---
drivers/iio/dac/ad5696-i2c.c | 9 ++++++---
4 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/iio/dac/ad5686-spi.c b/drivers/iio/dac/ad5686-spi.c
index df8619e0c092..b4df06f6bf02 100644
--- a/drivers/iio/dac/ad5686-spi.c
+++ b/drivers/iio/dac/ad5686-spi.c
@@ -8,11 +8,15 @@
* Copyright 2018 Analog Devices Inc.
*/

-#include "ad5686.h"
-
+#include <asm/byteorder.h>
+#include <linux/array_size.h>
+#include <linux/err.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/spi/spi.h>

+#include "ad5686.h"
+
static int ad5686_spi_write(struct ad5686_state *st,
u8 cmd, u8 addr, u16 val)
{
diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
index 9a384c50929b..1a6eb3832f22 100644
--- a/drivers/iio/dac/ad5686.c
+++ b/drivers/iio/dac/ad5686.c
@@ -5,17 +5,12 @@
* Copyright 2011 Analog Devices Inc.
*/

-#include <linux/interrupt.h>
-#include <linux/fs.h>
-#include <linux/device.h>
+#include <linux/array_size.h>
+#include <linux/err.h>
+#include <linux/export.h>
#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/sysfs.h>
#include <linux/regulator/consumer.h>
-
-#include <linux/iio/iio.h>
-#include <linux/iio/sysfs.h>
+#include <linux/sysfs.h>

#include "ad5686.h"

diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h
index e7d36bae3e59..3fcc792ea656 100644
--- a/drivers/iio/dac/ad5686.h
+++ b/drivers/iio/dac/ad5686.h
@@ -8,10 +8,9 @@
#ifndef __DRIVERS_IIO_DAC_AD5686_H__
#define __DRIVERS_IIO_DAC_AD5686_H__

-#include <linux/types.h>
-#include <linux/cache.h>
+#include <linux/bits.h>
#include <linux/mutex.h>
-#include <linux/kernel.h>
+#include <linux/types.h>

#include <linux/iio/iio.h>

diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c
index d3327bca0e07..587f53228bae 100644
--- a/drivers/iio/dac/ad5696-i2c.c
+++ b/drivers/iio/dac/ad5696-i2c.c
@@ -7,10 +7,13 @@
* Copyright 2018 Analog Devices Inc.
*/

-#include "ad5686.h"
-
-#include <linux/module.h>
+#include <asm/byteorder.h>
+#include <linux/err.h>
#include <linux/i2c.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+
+#include "ad5686.h"

static int ad5686_i2c_read(struct ad5686_state *st, u8 addr)
{

--
2.43.0