diff options
Diffstat (limited to 'drivers/pci/setup-res.c')
| -rw-r--r-- | drivers/pci/setup-res.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 7d678bb15ffb..17bed18d24ad 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
| @@ -93,8 +93,7 @@ void pci_update_resource(struct pci_dev *dev, int resno) | |||
| 93 | int pci_claim_resource(struct pci_dev *dev, int resource) | 93 | int pci_claim_resource(struct pci_dev *dev, int resource) |
| 94 | { | 94 | { |
| 95 | struct resource *res = &dev->resource[resource]; | 95 | struct resource *res = &dev->resource[resource]; |
| 96 | struct resource *root; | 96 | struct resource *root, *conflict; |
| 97 | int err; | ||
| 98 | 97 | ||
| 99 | root = pci_find_parent_resource(dev, res); | 98 | root = pci_find_parent_resource(dev, res); |
| 100 | if (!root) { | 99 | if (!root) { |
| @@ -103,12 +102,15 @@ int pci_claim_resource(struct pci_dev *dev, int resource) | |||
| 103 | return -EINVAL; | 102 | return -EINVAL; |
| 104 | } | 103 | } |
| 105 | 104 | ||
| 106 | err = request_resource(root, res); | 105 | conflict = request_resource_conflict(root, res); |
| 107 | if (err) | 106 | if (conflict) { |
| 108 | dev_err(&dev->dev, | 107 | dev_err(&dev->dev, |
| 109 | "address space collision: %pR already in use\n", res); | 108 | "address space collision: %pR conflicts with %s %pR\n", |
| 109 | res, conflict->name, conflict); | ||
| 110 | return -EBUSY; | ||
| 111 | } | ||
| 110 | 112 | ||
| 111 | return err; | 113 | return 0; |
| 112 | } | 114 | } |
| 113 | EXPORT_SYMBOL(pci_claim_resource); | 115 | EXPORT_SYMBOL(pci_claim_resource); |
| 114 | 116 | ||
