PCI: microchip: handle clock cleanup registration failures
Subsystems (5)
PATCH 1/1 PCI: microchip: handle clock cleanup registration failures
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.
--- drivers/pci/controller/plda/pcie-microchip-host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/plda/pcie-microchip-host.c +3 -1
@@ -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; }
Signature · 1 line
2.34.1
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 10 lines
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 makesmc_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 <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1