[RESEND PATCH 2/2] PCI: stm32: use pinctrl_pm_select_init_state() in stm32_pcie_resume_noirq()
Christian Bruel
christian.bruel at foss.st.com
Wed Jul 16 23:30:42 PDT 2025
Replace direct access to dev->pins->init_state with the new helper
pinctrl_pm_select_init_state() to select the init pinctrl state.
This fixes build issues when CONFIG_PINCTRL is not defined.
Signed-off-by: Christian Bruel <christian.bruel at foss.st.com>
Reported-by: Bjorn Helgaas <bhelgaas at google.com>
Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506260920.bmQ9hQ9s-lkp@intel.com/
Fixes: 633f42f48af5 ("PCI: stm32: Add PCIe host support for STM32MP25")
---
drivers/pci/controller/dwc/pcie-stm32.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-stm32.c b/drivers/pci/controller/dwc/pcie-stm32.c
index 50fae5f5ced2..c1d803dc3778 100644
--- a/drivers/pci/controller/dwc/pcie-stm32.c
+++ b/drivers/pci/controller/dwc/pcie-stm32.c
@@ -28,6 +28,7 @@ struct stm32_pcie {
struct clk *clk;
struct gpio_desc *perst_gpio;
struct gpio_desc *wake_gpio;
+ bool have_pinctrl_init;
};
static void stm32_pcie_deassert_perst(struct stm32_pcie *stm32_pcie)
@@ -91,10 +92,10 @@ static int stm32_pcie_resume_noirq(struct device *dev)
/*
* The core clock is gated with CLKREQ# from the COMBOPHY REFCLK,
* thus if no device is present, must force it low with an init pinmux
- * to be able to access the DBI registers.
+ * if present to be able to access the DBI registers.
*/
- if (!IS_ERR(dev->pins->init_state))
- ret = pinctrl_select_state(dev->pins->p, dev->pins->init_state);
+ if (stm32_pcie->have_pinctrl_init)
+ ret = pinctrl_pm_select_init_state(dev);
else
ret = pinctrl_pm_select_default_state(dev);
@@ -274,6 +275,9 @@ static int stm32_pcie_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(stm32_pcie->rst),
"Failed to get PCIe reset\n");
+ if (device_property_match_string(dev, "pinctrl-names", PINCTRL_STATE_INIT) >= 0)
+ stm32_pcie->have_pinctrl_init = true;
+
ret = stm32_pcie_parse_port(stm32_pcie);
if (ret)
return ret;
--
2.34.1
More information about the linux-arm-kernel
mailing list