aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/pcie-brcmstb.c
diff options
context:
space:
mode:
authorJim Quinlan <[email protected]>2025-02-14 17:39:33 +0000
committerKrzysztof Wilczyński <[email protected]>2025-03-04 16:01:30 +0000
commitb7de1b60ecab2f7b6f05d8116e93228a0bbb8563 (patch)
tree6776d7aa2901d015027148bc1731b5cefae3f72c /drivers/pci/controller/pcie-brcmstb.c
parentPCI: brcmstb: Fix error path after a call to regulator_bulk_get() (diff)
downloadkernel-b7de1b60ecab2f7b6f05d8116e93228a0bbb8563.tar.gz
kernel-b7de1b60ecab2f7b6f05d8116e93228a0bbb8563.zip
PCI: brcmstb: Fix potential premature regulator disabling
The platform supports enabling and disabling regulators only on ports below the Root Complex. Thus, we need to verify this both when adding and removing the bus, otherwise regulators may be disabled prematurely when a bus further down the topology is removed. Fixes: 9e6be018b263 ("PCI: brcmstb: Enable child bus device regulators from DT") Signed-off-by: Jim Quinlan <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]>
Diffstat (limited to 'drivers/pci/controller/pcie-brcmstb.c')
-rw-r--r--drivers/pci/controller/pcie-brcmstb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 7d1c6dc599da..d565153d8a37 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1440,7 +1440,7 @@ static void brcm_pcie_remove_bus(struct pci_bus *bus)
struct subdev_regulators *sr = pcie->sr;
struct device *dev = &bus->dev;
- if (!sr)
+ if (!sr || !bus->parent || !pci_is_root_bus(bus->parent))
return;
if (regulator_bulk_disable(sr->num_supplies, sr->supplies))