Commit 17a26354 authored by Wei Yongjun's avatar Wei Yongjun Committed by Chris Metcalf

tile/PCI: use for_each_pci_dev to simplify the code

Use for_each_pci_dev to simplify the code.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
parent 5955a596
...@@ -245,7 +245,7 @@ static void __devinit fixup_read_and_payload_sizes(void) ...@@ -245,7 +245,7 @@ static void __devinit fixup_read_and_payload_sizes(void)
u16 new_values; u16 new_values;
/* Scan for the smallest maximum payload size. */ /* Scan for the smallest maximum payload size. */
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { for_each_pci_dev(dev) {
u32 devcap; u32 devcap;
int max_payload; int max_payload;
...@@ -260,7 +260,7 @@ static void __devinit fixup_read_and_payload_sizes(void) ...@@ -260,7 +260,7 @@ static void __devinit fixup_read_and_payload_sizes(void)
/* Now, set the max_payload_size for all devices to that value. */ /* Now, set the max_payload_size for all devices to that value. */
new_values = (max_read_size << 12) | (smallest_max_payload << 5); new_values = (max_read_size << 12) | (smallest_max_payload << 5);
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) for_each_pci_dev(dev)
pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL, pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_PAYLOAD | PCI_EXP_DEVCTL_READRQ, PCI_EXP_DEVCTL_PAYLOAD | PCI_EXP_DEVCTL_READRQ,
new_values); new_values);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment