Skip to content

Commit 0c0cbb6

Browse files
committed
PCI/ASPM: Simplify Clock Power Management setting
Update the Link Control Enable Clock Power Management bit the same way we update the ASPM Control bits, with a single call of pcie_capability_clear_and_set_word(). No functional change; this just makes both paths use the same style. Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 777e61e commit 0c0cbb6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/pci/pcie/aspm.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,12 @@ static void pcie_set_clkpm_nocheck(struct pcie_link_state *link, int enable)
127127
{
128128
struct pci_dev *child;
129129
struct pci_bus *linkbus = link->pdev->subordinate;
130+
u32 val = enable ? PCI_EXP_LNKCTL_CLKREQ_EN : 0;
130131

131-
list_for_each_entry(child, &linkbus->devices, bus_list) {
132-
if (enable)
133-
pcie_capability_set_word(child, PCI_EXP_LNKCTL,
134-
PCI_EXP_LNKCTL_CLKREQ_EN);
135-
else
136-
pcie_capability_clear_word(child, PCI_EXP_LNKCTL,
137-
PCI_EXP_LNKCTL_CLKREQ_EN);
138-
}
132+
list_for_each_entry(child, &linkbus->devices, bus_list)
133+
pcie_capability_clear_and_set_word(child, PCI_EXP_LNKCTL,
134+
PCI_EXP_LNKCTL_CLKREQ_EN,
135+
val);
139136
link->clkpm_enabled = !!enable;
140137
}
141138

0 commit comments

Comments
 (0)