diff mbox series

[03/12] iio:accel:bosch drivers: Cleanup includes

Message ID 20210611171355.202903-4-jic23@kernel.org (mailing list archive)
State New
Headers show
Series iio:accel: Header Cleanups. | expand

Commit Message

Jonathan Cameron June 11, 2021, 5:13 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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@huawei.com>
Cc: Dan Robertson <dan@dlrobertson.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mike Looijmans <mike.looijmans@topic.nl>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 mbox series

Patch

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@pengutronix.de>
  */
 
-#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"