diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2020-06-04 19:59:12 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-06-04 19:59:12 +0200 |
commit | b16666b853597531a798f57e7cb38d510c9e6efd (patch) | |
tree | e2048e969009c67084f82ffa10d2e9573ad74ce7 /drivers/pci | |
parent | Merge branch 'pci/pm' (diff) | |
parent | PCI: Allow pci_resize_resource() for devices on root bus (diff) | |
download | linux-b16666b853597531a798f57e7cb38d510c9e6efd.tar.xz linux-b16666b853597531a798f57e7cb38d510c9e6efd.zip |
Merge branch 'pci/resource'
- Allow resizing BARs of devices on root bus (Ard Biesheuvel)
* pci/resource:
PCI: Allow pci_resize_resource() for devices on root bus
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/setup-res.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index d8ca40a97693..d21fa04fa44d 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -439,10 +439,11 @@ int pci_resize_resource(struct pci_dev *dev, int resno, int size) res->end = res->start + pci_rebar_size_to_bytes(size) - 1; /* Check if the new config works by trying to assign everything. */ - ret = pci_reassign_bridge_resources(dev->bus->self, res->flags); - if (ret) - goto error_resize; - + if (dev->bus->self) { + ret = pci_reassign_bridge_resources(dev->bus->self, res->flags); + if (ret) + goto error_resize; + } return 0; error_resize: |