* [PATCH v2 1/1] PCI: stm32: Don't use "proxy" headers
@ 2025-11-14 18:52 Andy Shevchenko
2025-11-17 20:43 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2025-11-14 18:52 UTC (permalink / raw)
To: Christian Bruel, Andy Shevchenko, linux-pci, linux-stm32,
linux-arm-kernel, linux-kernel
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas,
Maxime Coquelin, Alexandre Torgue
Update header inclusions to follow IWYU (Include What You Use)
principle.
In particular, replace of_gpio.h, which is subject to remove by the GPIOLIB
subsystem, with the respective headers that are being used by the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: took care of pci-stm32.* as well (Christian)
drivers/pci/controller/dwc/pcie-stm32-ep.c | 2 +-
drivers/pci/controller/dwc/pcie-stm32.c | 14 +++++++++++++-
drivers/pci/controller/dwc/pcie-stm32.h | 3 +++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-stm32-ep.c b/drivers/pci/controller/dwc/pcie-stm32-ep.c
index 3400c7cd2d88..2b9b451306fc 100644
--- a/drivers/pci/controller/dwc/pcie-stm32-ep.c
+++ b/drivers/pci/controller/dwc/pcie-stm32-ep.c
@@ -7,9 +7,9 @@
*/
#include <linux/clk.h>
+#include <linux/gpio/consumer.h>
#include <linux/mfd/syscon.h>
#include <linux/of_platform.h>
-#include <linux/of_gpio.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
diff --git a/drivers/pci/controller/dwc/pcie-stm32.c b/drivers/pci/controller/dwc/pcie-stm32.c
index 96a5fb893af4..a9e77478443b 100644
--- a/drivers/pci/controller/dwc/pcie-stm32.c
+++ b/drivers/pci/controller/dwc/pcie-stm32.c
@@ -7,18 +7,30 @@
*/
#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/gpio/consumer.h>
+#include <linux/irq.h>
#include <linux/mfd/syscon.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/phy/phy.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
+#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>
#include <linux/reset.h>
+#include <linux/stddef.h>
+
+#include "../../pci.h"
+
#include "pcie-designware.h"
#include "pcie-stm32.h"
-#include "../../pci.h"
struct stm32_pcie {
struct dw_pcie pci;
diff --git a/drivers/pci/controller/dwc/pcie-stm32.h b/drivers/pci/controller/dwc/pcie-stm32.h
index 09d39f04e469..419cf1ff669d 100644
--- a/drivers/pci/controller/dwc/pcie-stm32.h
+++ b/drivers/pci/controller/dwc/pcie-stm32.h
@@ -6,6 +6,9 @@
* Author: Christian Bruel <christian.bruel@foss.st.com>
*/
+#include <linux/bits.h>
+#include <linux/device.h>
+
#define to_stm32_pcie(x) dev_get_drvdata((x)->dev)
#define STM32MP25_PCIECR_TYPE_MASK GENMASK(11, 8)
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2 1/1] PCI: stm32: Don't use "proxy" headers
2025-11-14 18:52 [PATCH v2 1/1] PCI: stm32: Don't use "proxy" headers Andy Shevchenko
@ 2025-11-17 20:43 ` Bjorn Helgaas
2025-11-18 12:42 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2025-11-17 20:43 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Christian Bruel, linux-pci, linux-stm32, linux-arm-kernel,
linux-kernel, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas,
Maxime Coquelin, Alexandre Torgue
On Fri, Nov 14, 2025 at 07:52:01PM +0100, Andy Shevchenko wrote:
> Update header inclusions to follow IWYU (Include What You Use)
> principle.
>
> In particular, replace of_gpio.h, which is subject to remove by the GPIOLIB
> subsystem, with the respective headers that are being used by the driver.
Thanks, Andy! It looks like a lot of work to figure this out by hand.
Is there a tool to figure this out? Maybe something I could run when
reviewing patches?
IWYU seems like a nice principle but I couldn't find any mention in
Documentation/. Should it be covered there somehow?
Bjorn
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] PCI: stm32: Don't use "proxy" headers
2025-11-17 20:43 ` Bjorn Helgaas
@ 2025-11-18 12:42 ` Andy Shevchenko
0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2025-11-18 12:42 UTC (permalink / raw)
To: Bjorn Helgaas, Jonathan Cameron
Cc: Christian Bruel, linux-pci, linux-stm32, linux-arm-kernel,
linux-kernel, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas,
Maxime Coquelin, Alexandre Torgue
On Mon, Nov 17, 2025 at 02:43:48PM -0600, Bjorn Helgaas wrote:
> On Fri, Nov 14, 2025 at 07:52:01PM +0100, Andy Shevchenko wrote:
> > Update header inclusions to follow IWYU (Include What You Use)
> > principle.
> >
> > In particular, replace of_gpio.h, which is subject to remove by the GPIOLIB
> > subsystem, with the respective headers that are being used by the driver.
>
> Thanks, Andy! It looks like a lot of work to figure this out by hand.
True.
> Is there a tool to figure this out? Maybe something I could run when
> reviewing patches?
I have a déjà vu answering this question. Was it you last time who asked
the same?
The tool is iwyu which is heavily tuned for the kernel use by Jonathan (Cc'ed).
But I do it manually.
> IWYU seems like a nice principle but I couldn't find any mention in
> Documentation/. Should it be covered there somehow?
Perhaps. Maybe we can start with IIO, where it's a highly recommended thing
for the new code submissions.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-18 12:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-14 18:52 [PATCH v2 1/1] PCI: stm32: Don't use "proxy" headers Andy Shevchenko
2025-11-17 20:43 ` Bjorn Helgaas
2025-11-18 12:42 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox