diff options
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r-- | drivers/pci/setup-res.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 7f7652176fc5..6e443135ba24 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -111,18 +111,23 @@ int pci_claim_resource(struct pci_dev *dev, int resource) | |||
111 | struct resource *res = &dev->resource[resource]; | 111 | struct resource *res = &dev->resource[resource]; |
112 | struct resource *root, *conflict; | 112 | struct resource *root, *conflict; |
113 | 113 | ||
114 | if (res->flags & IORESOURCE_UNSET) { | ||
115 | dev_info(&dev->dev, "can't claim BAR %d %pR: no address assigned\n", | ||
116 | resource, res); | ||
117 | return -EINVAL; | ||
118 | } | ||
119 | |||
114 | root = pci_find_parent_resource(dev, res); | 120 | root = pci_find_parent_resource(dev, res); |
115 | if (!root) { | 121 | if (!root) { |
116 | dev_info(&dev->dev, "no compatible bridge window for %pR\n", | 122 | dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", |
117 | res); | 123 | resource, res); |
118 | return -EINVAL; | 124 | return -EINVAL; |
119 | } | 125 | } |
120 | 126 | ||
121 | conflict = request_resource_conflict(root, res); | 127 | conflict = request_resource_conflict(root, res); |
122 | if (conflict) { | 128 | if (conflict) { |
123 | dev_info(&dev->dev, | 129 | dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", |
124 | "address space collision: %pR conflicts with %s %pR\n", | 130 | resource, res, conflict->name, conflict); |
125 | res, conflict->name, conflict); | ||
126 | return -EBUSY; | 131 | return -EBUSY; |
127 | } | 132 | } |
128 | 133 | ||