Loading drivers/pci/hotplug/cpqphp_pci.c +39 −46 Original line number Diff line number Diff line Loading @@ -494,7 +494,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) u8 secondary_bus; int sub_bus; int max_functions; int function; int function = 0; int cloop = 0; int stop_it; Loading @@ -503,7 +503,9 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) ctrl->pci_bus->number = new_slot->bus; pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID); if (ID != 0xFFFFFFFF) { /* device in slot */ if (ID == 0xFFFFFFFF) return 2; pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), 0x0B, &class_code); pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_HEADER_TYPE, &header_type); Loading @@ -512,9 +514,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) else max_functions = 1; function = 0; do { while (function < max_functions) { if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* Recurse the subordinate bus */ pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_SECONDARY_BUS, &secondary_bus); Loading @@ -529,13 +529,12 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) return(rc); ctrl->pci_bus->number = new_slot->bus; } /* End of IF */ } new_slot->status = 0; for (cloop = 0; cloop < 0x20; cloop++) { for (cloop = 0; cloop < 0x20; cloop++) pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), cloop << 2, (u32 *) & (new_slot-> config_space [cloop])); } function++; Loading @@ -547,21 +546,15 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) while ((function < max_functions) && (!stop_it)) { pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_VENDOR_ID, &ID); if (ID == 0xFFFFFFFF) { /* nothing there. */ if (ID == 0xFFFFFFFF) function++; } else { /* Something there */ else { pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), 0x0B, &class_code); pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_HEADER_TYPE, &header_type); stop_it++; } } } while (function < max_functions); } /* End of IF (device in slot?) */ else { return 2; } return 0; Loading Loading
drivers/pci/hotplug/cpqphp_pci.c +39 −46 Original line number Diff line number Diff line Loading @@ -494,7 +494,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) u8 secondary_bus; int sub_bus; int max_functions; int function; int function = 0; int cloop = 0; int stop_it; Loading @@ -503,7 +503,9 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) ctrl->pci_bus->number = new_slot->bus; pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID); if (ID != 0xFFFFFFFF) { /* device in slot */ if (ID == 0xFFFFFFFF) return 2; pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), 0x0B, &class_code); pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_HEADER_TYPE, &header_type); Loading @@ -512,9 +514,7 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) else max_functions = 1; function = 0; do { while (function < max_functions) { if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* Recurse the subordinate bus */ pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_SECONDARY_BUS, &secondary_bus); Loading @@ -529,13 +529,12 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) return(rc); ctrl->pci_bus->number = new_slot->bus; } /* End of IF */ } new_slot->status = 0; for (cloop = 0; cloop < 0x20; cloop++) { for (cloop = 0; cloop < 0x20; cloop++) pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), cloop << 2, (u32 *) & (new_slot-> config_space [cloop])); } function++; Loading @@ -547,21 +546,15 @@ int cpqhp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) while ((function < max_functions) && (!stop_it)) { pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_VENDOR_ID, &ID); if (ID == 0xFFFFFFFF) { /* nothing there. */ if (ID == 0xFFFFFFFF) function++; } else { /* Something there */ else { pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), 0x0B, &class_code); pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(new_slot->device, function), PCI_HEADER_TYPE, &header_type); stop_it++; } } } while (function < max_functions); } /* End of IF (device in slot?) */ else { return 2; } return 0; Loading