diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-26 22:25:58 +0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-27 21:43:32 +0400 |
commit | bd064f0a231af336218838474ea45a64f1672190 (patch) | |
tree | a1deda3444f1c2554e22c6969641352cc2cc8eb1 /drivers/pci/pci.c | |
parent | f44116ae881868ab72274df1eff48fdbde9898af (diff) | |
download | linux-bd064f0a231af336218838474ea45a64f1672190.tar.xz |
PCI: Mark resources as IORESOURCE_UNSET if we can't assign them
When assigning addresses to resources, mark them with IORESOURCE_UNSET
before we start and clear IORESOURCE_UNSET if assignment is successful.
That means that if we print the resource during assignment, we will show
the size, not a meaningless address.
Also, clear IORESOURCE_UNSET if we do assign an address, so we print the
address when it is valid.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 99293fa40db9..dc9ce62be7aa 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4244,6 +4244,7 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev) "Rounding up size of resource #%d to %#llx.\n", i, (unsigned long long)size); } + r->flags |= IORESOURCE_UNSET; r->end = size - 1; r->start = 0; } @@ -4257,6 +4258,7 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev) r = &dev->resource[i]; if (!(r->flags & IORESOURCE_MEM)) continue; + r->flags |= IORESOURCE_UNSET; r->end = resource_size(r) - 1; r->start = 0; } |