From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Based on consideration of the output of the include-what-you-use tool. Remove unused headers and add some that are directly used in the files. There are no hard rules on when to use direct includes and when to rely on a chain of headers. Here I'm trying to make those decisions approximately the same across IIO. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Cc: Dan Robertson <dan@xxxxxxxxxxxxxxx> Cc: Hans de Goede <hdegoede@xxxxxxxxxx> Cc: Mike Looijmans <mike.looijmans@xxxxxxxx> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx> Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> --- drivers/iio/accel/bma180.c | 4 ++-- drivers/iio/accel/bma220_spi.c | 2 +- drivers/iio/accel/bma400_core.c | 1 - drivers/iio/accel/bma400_spi.c | 1 - drivers/iio/accel/bmc150-accel-core.c | 1 + drivers/iio/accel/bmc150-accel-spi.c | 1 - drivers/iio/accel/bmi088-accel-core.c | 3 --- drivers/iio/accel/bmi088-accel-spi.c | 3 ++- 8 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 0e0d9317c084..2042cf86b199 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -14,14 +14,14 @@ */ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/i2c.h> #include <linux/interrupt.h> #include <linux/delay.h> #include <linux/property.h> +#include <linux/mutex.h> #include <linux/bitops.h> #include <linux/regulator/consumer.h> -#include <linux/slab.h> -#include <linux/string.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/iio/buffer.h> diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index 0622c7936499..c447463d0844 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -9,11 +9,11 @@ #include <linux/kernel.h> #include <linux/mod_devicetable.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/spi/spi.h> #include <linux/iio/buffer.h> #include <linux/iio/iio.h> -#include <linux/iio/sysfs.h> #include <linux/iio/trigger_consumer.h> #include <linux/iio/triggered_buffer.h> diff --git a/drivers/iio/accel/bma400_core.c b/drivers/iio/accel/bma400_core.c index 21520e022a21..8595dd666c44 100644 --- a/drivers/iio/accel/bma400_core.c +++ b/drivers/iio/accel/bma400_core.c @@ -14,7 +14,6 @@ #include <linux/bitops.h> #include <linux/device.h> #include <linux/iio/iio.h> -#include <linux/iio/sysfs.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/mutex.h> diff --git a/drivers/iio/accel/bma400_spi.c b/drivers/iio/accel/bma400_spi.c index 7c2825904e08..0ae3d1a203b4 100644 --- a/drivers/iio/accel/bma400_spi.c +++ b/drivers/iio/accel/bma400_spi.c @@ -6,7 +6,6 @@ * */ #include <linux/bits.h> -#include <linux/init.h> #include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/regmap.h> diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index 46ab7675186c..06e396b66e02 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -18,6 +18,7 @@ #include <linux/delay.h> #include <linux/slab.h> #include <linux/acpi.h> +#include <linux/mutex.h> #include <linux/pm.h> #include <linux/pm_runtime.h> #include <linux/iio/iio.h> diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c index 74a8aee4f612..0786c9a0dcbb 100644 --- a/drivers/iio/accel/bmc150-accel-spi.c +++ b/drivers/iio/accel/bmc150-accel-spi.c @@ -4,7 +4,6 @@ * Copyright © 2015 Pengutronix, Markus Pargmann <mpa@xxxxxxxxxxxxxx> */ -#include <linux/device.h> #include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/acpi.h> diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index a06dae5c971d..d50db25cce64 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -8,13 +8,10 @@ #include <linux/delay.h> #include <linux/iio/iio.h> -#include <linux/iio/sysfs.h> -#include <linux/interrupt.h> #include <linux/module.h> #include <linux/pm.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> -#include <linux/slab.h> #include <asm/unaligned.h> #include "bmi088-accel.h" diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c index dd1e3f6cf211..ae999c08e038 100644 --- a/drivers/iio/accel/bmi088-accel-spi.c +++ b/drivers/iio/accel/bmi088-accel-spi.c @@ -6,9 +6,10 @@ * Copyright (c) 2018-2020, Topic Embedded Products */ +#include <linux/bits.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/regmap.h> -#include <linux/slab.h> #include <linux/spi/spi.h> #include "bmi088-accel.h" -- 2.31.1