linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: stm32: Remove link_status in PCIe EP.
@ 2025-09-02 12:26 Christian Bruel
  0 siblings, 0 replies; only message in thread
From: Christian Bruel @ 2025-09-02 12:26 UTC (permalink / raw)
  To: christian.bruel, lpieralisi, kwilczynski, mani, robh, bhelgaas,
	mcoquelin.stm32, alexandre.torgue
  Cc: linux-pci, linux-stm32, linux-arm-kernel, linux-kernel

Guarding enable_irq/disable_irq against successive link start
link does not seem necessary, since it is not possible to start
the link twice. Similarly for stop.

Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
Message-ID: <20250828192054.GA957771@bhelgaas>
---
 drivers/pci/controller/dwc/pcie-stm32-ep.c | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-stm32-ep.c b/drivers/pci/controller/dwc/pcie-stm32-ep.c
index 1f46bcf0c79f..a00edb6067f1 100644
--- a/drivers/pci/controller/dwc/pcie-stm32-ep.c
+++ b/drivers/pci/controller/dwc/pcie-stm32-ep.c
@@ -18,11 +18,6 @@
 #include "pcie-designware.h"
 #include "pcie-stm32.h"
 
-enum stm32_pcie_ep_link_status {
-	STM32_PCIE_EP_LINK_DISABLED,
-	STM32_PCIE_EP_LINK_ENABLED,
-};
-
 struct stm32_pcie {
 	struct dw_pcie pci;
 	struct regmap *regmap;
@@ -30,7 +25,6 @@ struct stm32_pcie {
 	struct phy *phy;
 	struct clk *clk;
 	struct gpio_desc *perst_gpio;
-	enum stm32_pcie_ep_link_status link_status;
 	unsigned int perst_irq;
 };
 
@@ -66,11 +60,6 @@ static int stm32_pcie_start_link(struct dw_pcie *pci)
 	struct stm32_pcie *stm32_pcie = to_stm32_pcie(pci);
 	int ret;
 
-	if (stm32_pcie->link_status == STM32_PCIE_EP_LINK_ENABLED) {
-		dev_dbg(pci->dev, "Link is already enabled\n");
-		return 0;
-	}
-
 	dev_dbg(pci->dev, "Enable link\n");
 
 	ret = stm32_pcie_enable_link(pci);
@@ -81,8 +70,6 @@ static int stm32_pcie_start_link(struct dw_pcie *pci)
 
 	enable_irq(stm32_pcie->perst_irq);
 
-	stm32_pcie->link_status = STM32_PCIE_EP_LINK_ENABLED;
-
 	return 0;
 }
 
@@ -90,18 +77,11 @@ static void stm32_pcie_stop_link(struct dw_pcie *pci)
 {
 	struct stm32_pcie *stm32_pcie = to_stm32_pcie(pci);
 
-	if (stm32_pcie->link_status == STM32_PCIE_EP_LINK_DISABLED) {
-		dev_dbg(pci->dev, "Link is already disabled\n");
-		return;
-	}
-
 	dev_dbg(pci->dev, "Disable link\n");
 
 	disable_irq(stm32_pcie->perst_irq);
 
 	stm32_pcie_disable_link(pci);
-
-	stm32_pcie->link_status = STM32_PCIE_EP_LINK_DISABLED;
 }
 
 static int stm32_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-02 12:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 12:26 [PATCH] PCI: stm32: Remove link_status in PCIe EP Christian Bruel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).