[PATCH 3/3] iio: common: st_sensors: fix includes with IWYU

Caio Morais
2026-04-26T21:20:41Z

From: Caio Morais <caiomorais@usp.br>

Signed-off-by: Caio Morais <caiomorais@usp.br>
---
drivers/iio/common/st_sensors/st_sensors_i2c.c | 7 +++++--
drivers/iio/common/st_sensors/st_sensors_spi.c | 9 +++++++--
2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/common/st_sensors/st_sensors_i2c.c b/drivers/iio/common/st_sensors/st_sensors_i2c.c
index 7156302fe..04d106def 100644
--- a/drivers/iio/common/st_sensors/st_sensors_i2c.c
+++ b/drivers/iio/common/st_sensors/st_sensors_i2c.c
@@ -7,12 +7,15 @@
* Denis Ciocca <denis.ciocca@st.com>
*/

+#include <linux/device.h>
+#include <linux/err.h>
#include <linux/i2c.h>
-#include <linux/kernel.h>
+#include <linux/linkage.h>
#include <linux/module.h>
-#include <linux/iio/iio.h>
#include <linux/regmap.h>

+#include <linux/iio/iio.h>
+
#include <linux/iio/common/st_sensors_i2c.h>

#define ST_SENSORS_I2C_MULTIREAD 0x80
diff --git a/drivers/iio/common/st_sensors/st_sensors_spi.c b/drivers/iio/common/st_sensors/st_sensors_spi.c
index 0da270139..884077d51 100644
--- a/drivers/iio/common/st_sensors/st_sensors_spi.c
+++ b/drivers/iio/common/st_sensors/st_sensors_spi.c
@@ -7,12 +7,17 @@
* Denis Ciocca <denis.ciocca@st.com>
*/

-#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/linkage.h>
#include <linux/module.h>
-#include <linux/iio/iio.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+
+#include <linux/iio/iio.h>

#include <linux/iio/common/st_sensors_spi.h>

--
2.54.0