Skip to content

Commit 9d66238

Browse files
jamesequinlanpopcornmix
authored andcommitted
PCI: brcmstb: Fix potential premature regulator disabling
Our system for enabling and disabling regulators is designed to work only on the port driver below the root complex. The conditions to discriminate for this case should be the same when we are adding or removing the bus. Without this change the regulators may be disabled prematurely when a bus further down the tree is removed. Fixes: 9e6be01 ("PCI: brcmstb: Enable child bus device regulators from DT") Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
1 parent 5a8dc12 commit 9d66238

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ static void brcm_pcie_remove_bus(struct pci_bus *bus)
14401440
struct subdev_regulators *sr = pcie->sr;
14411441
struct device *dev = &bus->dev;
14421442

1443-
if (!sr)
1443+
if (!sr || !bus->parent || !pci_is_root_bus(bus->parent))
14441444
return;
14451445

14461446
if (regulator_bulk_disable(sr->num_supplies, sr->supplies))

0 commit comments

Comments
 (0)