From: Jiawen Liu <1298662399@qq.com>
To: "Conor Dooley" <conor.dooley@microchip.com>,
"Daire McNamara" <daire.mcnamara@microchip.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>
Cc: Rob Herring <robh@kernel.org>,
linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] PCI: microchip: handle clock cleanup registration failures
Date: Sun, 29 Nov 2026 17:44:54 +0400 [thread overview]
Message-ID: <tencent_06BA22104833DD66A70640855FE04AFC7A07@qq.com> (raw)
mc_pcie_init_clk() enables a FIC clock and registers a devres action to
disable it. If registering that action fails, the reset helper disables
the clock immediately, but the ignored error makes mc_pcie_init_clk()
return a valid clock pointer. Probe can then continue without retaining
the required clock enable.
Return the registration error before proceeding with PCI host setup.
Fixes: 6f15a9c9f941 ("PCI: microchip: Add Microchip PolarFire PCIe controller driver")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
drivers/pci/controller/plda/pcie-microchip-host.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c
index ae26afbb73dd0..c118eef73d60a 100644
--- a/drivers/pci/controller/plda/pcie-microchip-host.c
+++ b/drivers/pci/controller/plda/pcie-microchip-host.c
@@ -521,7 +521,9 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
if (ret)
return ERR_PTR(ret);
- devm_add_action_or_reset(dev, mc_pcie_deinit_clk, clk);
+ ret = devm_add_action_or_reset(dev, mc_pcie_deinit_clk, clk);
+ if (ret)
+ return ERR_PTR(ret);
return clk;
}
--
2.34.1
reply other threads:[~2026-11-29 13:45 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=tencent_06BA22104833DD66A70640855FE04AFC7A07@qq.com \
--to=1298662399@qq.com \
--cc=bhelgaas@google.com \
--cc=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--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
all inboxes | Powered by JetHome®