Skip to content

Commit d753323

Browse files
committed
s390/PCI: Use generic pci_enable_resources()
The generic pci_enable_resources() does essentially the same thing as the code in the s390 version of pcibios_enable_device(). There are differences, but I don't think any of them are a problem. The generic code: - Checks everything up to PCI_NUM_RESOURCES, not PCI_BAR_COUNT (6), so we'll now check the ROM resource, IOV resources, and bridge windows. - Checks for res->flags & IORESOURCE_UNSET. The s390 code never sets IORESOURCE_UNSET, so this isn't a problem. - Checks res->parent. The s390 pcibios_add_device() calls pci_claim_resource() on all BARs (except ROM, IOV, and bridge windows) so this isn't a problem either. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
1 parent 05d58f6 commit d753323

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

‎arch/s390/pci/pci.c‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -686,27 +686,13 @@ int pcibios_add_device(struct pci_dev *pdev)
686686
int pcibios_enable_device(struct pci_dev *pdev, int mask)
687687
{
688688
struct zpci_dev *zdev = get_zdev(pdev);
689-
struct resource *res;
690-
u16 cmd;
691-
int i;
692689

693690
zdev->pdev = pdev;
694691
zpci_debug_init_device(zdev);
695692
zpci_fmb_enable_device(zdev);
696693
zpci_map_resources(zdev);
697694

698-
pci_read_config_word(pdev, PCI_COMMAND, &cmd);
699-
for (i = 0; i < PCI_BAR_COUNT; i++) {
700-
res = &pdev->resource[i];
701-
702-
if (res->flags & IORESOURCE_IO)
703-
return -EINVAL;
704-
705-
if (res->flags & IORESOURCE_MEM)
706-
cmd |= PCI_COMMAND_MEMORY;
707-
}
708-
pci_write_config_word(pdev, PCI_COMMAND, cmd);
709-
return 0;
695+
return pci_enable_resources(pdev, mask);
710696
}
711697

712698
void pcibios_disable_device(struct pci_dev *pdev)

0 commit comments

Comments
 (0)