From: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
To: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org
Cc: ~lkcamp/patches@lists.sr.ht, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] iio: adc: spear_adc: cleans up, update and sorts the existing includes
Date: Sat, 6 Dec 2025 10:15:12 -0300 [thread overview]
Message-ID: <20251206132120.11059-1-rodrigo.gobbi.7@gmail.com> (raw)
Remove unused includes and add what is being used (IWYU principle) and
sort the remaining ones.
Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
---
My reasoning was not correct at [1], tks for pointing that out @Jonathan.
With that in mind, I've reviewed some discussions about the principle and
I`ve changed a little bit approach: I`ve inspected the source code again
to find out what was being used and also checked incorrectly "indirect includes"
using the spear_adc.i file to avoid them. The result is something like this now:
Removed:
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/iio/sysfs.h>
Added:
#include <linux/array_size.h>
#include <linux/bits.h>
#include <linux/compiler_types.h>
#include <linux/dev_printk.h>
#include <linux/math.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/iio/types.h>
Tks and regards!
[1] https://lore.kernel.org/all/20251009182636.187026-1-rodrigo.gobbi.7@gmail.com/
---
drivers/iio/adc/spear_adc.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/iio/adc/spear_adc.c b/drivers/iio/adc/spear_adc.c
index 50b0a607baeb..b9eeed5533c6 100644
--- a/drivers/iio/adc/spear_adc.c
+++ b/drivers/iio/adc/spear_adc.c
@@ -5,22 +5,26 @@
* Copyright 2012 Stefan Roese <sr@denx.de>
*/
-#include <linux/mod_devicetable.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/property.h>
-#include <linux/interrupt.h>
-#include <linux/device.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/io.h>
+#include <linux/array_size.h>
#include <linux/bitfield.h>
+#include <linux/bits.h>
#include <linux/clk.h>
-#include <linux/err.h>
+#include <linux/compiler_types.h>
#include <linux/completion.h>
+#include <linux/dev_printk.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/math.h>
+#include <linux/module.h>
+#include <linux/mod_devicetable.h>
+#include <linux/mutex.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/iio/iio.h>
-#include <linux/iio/sysfs.h>
+#include <linux/iio/types.h>
/* SPEAR registers definitions */
#define SPEAR600_ADC_SCAN_RATE_LO(x) ((x) & 0xFFFF)
--
2.48.1
next reply other threads:[~2025-12-06 13:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 13:15 Rodrigo Gobbi [this message]
2025-12-06 15:33 ` Jonathan Cameron
2025-12-06 17:55 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251206132120.11059-1-rodrigo.gobbi.7@gmail.com \
--to=rodrigo.gobbi.7@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=~lkcamp/patches@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®