Skip to content

Commit e1bd928

Browse files
Manivannan Sadhasivambjorn-helgaas
authored andcommitted
PCI: tegra194: Rename 'root_bus' to 'root_port_bus' in tegra_pcie_downstream_dev_to_D0()
In tegra_pcie_downstream_dev_to_D0(), PCI devices are transitioned to D0 state. For iterating over the devices, first the downstream bus of the Root Port is searched from the root bus. But the name of the variable that holds the Root Port downstream bus is named as 'root_bus', which is wrong. Rename the variable to 'root_port_bus'. Also, move the comment on 'bringing the devices to D0' to where the state is set exactly. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20250922081057.15209-1-mani@kernel.org
1 parent 26fda92 commit e1bd928

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/pci/controller/dwc/pcie-tegra194.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ static int tegra_pcie_bpmp_set_pll_state(struct tegra_pcie_dw *pcie,
12701270
static void tegra_pcie_downstream_dev_to_D0(struct tegra_pcie_dw *pcie)
12711271
{
12721272
struct dw_pcie_rp *pp = &pcie->pci.pp;
1273-
struct pci_bus *child, *root_bus = NULL;
1273+
struct pci_bus *child, *root_port_bus = NULL;
12741274
struct pci_dev *pdev;
12751275

12761276
/*
@@ -1283,19 +1283,19 @@ static void tegra_pcie_downstream_dev_to_D0(struct tegra_pcie_dw *pcie)
12831283
*/
12841284

12851285
list_for_each_entry(child, &pp->bridge->bus->children, node) {
1286-
/* Bring downstream devices to D0 if they are not already in */
12871286
if (child->parent == pp->bridge->bus) {
1288-
root_bus = child;
1287+
root_port_bus = child;
12891288
break;
12901289
}
12911290
}
12921291

1293-
if (!root_bus) {
1294-
dev_err(pcie->dev, "Failed to find downstream devices\n");
1292+
if (!root_port_bus) {
1293+
dev_err(pcie->dev, "Failed to find downstream bus of Root Port\n");
12951294
return;
12961295
}
12971296

1298-
list_for_each_entry(pdev, &root_bus->devices, bus_list) {
1297+
/* Bring downstream devices to D0 if they are not already in */
1298+
list_for_each_entry(pdev, &root_port_bus->devices, bus_list) {
12991299
if (PCI_SLOT(pdev->devfn) == 0) {
13001300
if (pci_set_power_state(pdev, PCI_D0))
13011301
dev_err(pcie->dev,

0 commit comments

Comments
 (0)