From: Christian Bruel <christian.bruel@foss.st.com>
To: <christian.bruel@foss.st.com>, <lpieralisi@kernel.org>,
<kwilczynski@kernel.org>, <mani@kernel.org>, <robh@kernel.org>,
<bhelgaas@google.com>, <mcoquelin.stm32@gmail.com>,
<alexandre.torgue@foss.st.com>
Cc: <linux-pci@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] PCI: stm32: Remove link_status in PCIe EP.
Date: Tue, 2 Sep 2025 14:26:41 +0200 [thread overview]
Message-ID: <20250902122641.269725-1-christian.bruel@foss.st.com> (raw)
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
reply other threads:[~2025-09-02 12:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250902122641.269725-1-christian.bruel@foss.st.com \
--to=christian.bruel@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=bhelgaas@google.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).