@@ -98,23 +98,24 @@ void pci_update_resource(struct pci_dev *dev, int resno)
int pci_claim_resource(struct pci_dev *dev, int resource)
{
+ const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
struct resource *res = &dev->resource[resource];
struct resource *root;
int err;
root = pci_find_parent_resource(dev, res);
- err = -EINVAL;
- if (root != NULL)
- err = request_resource(root, res);
+ if (!root) {
+ dev_err(&dev->dev, "BAR %d: no parent resource for %s resource %pR\n",
+ resource, dtype, res);
+ return -EINVAL;
+ }
+
+ err = request_resource(root, res);
if (err) {
- const char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge";
- dev_err(&dev->dev, "BAR %d: %s of %s %pR\n",
- resource,
- root ? "address space collision on" :
- "no parent found for",
- dtype, res);
+ dev_err(&dev->dev, "BAR %d: unable to insert %s resource %pR in %pR\n",
+ resource, dtype, res, root);
}
return err;
@@ -609,7 +609,7 @@ static char *resource_string(char *buf, char *end, struct resource *res,
.flags = SPECIAL | SMALL | ZEROPAD,
};
/* room for the actual numbers, the two "0x", -, [, ] and the final zero */
- char sym[4*sizeof(resource_size_t) + 8];
+ char sym[4*sizeof(resource_size_t) + 8 + 9];
char *p = sym, *pend = sym + sizeof(sym);
int size = -1;
@@ -623,6 +623,8 @@ static char *resource_string(char *buf, char *end, struct resource *res,
p = number(p, pend, res->start, num_spec);
*p++ = '-';
p = number(p, pend, res->end, num_spec);
+ *p++ = ':';
+ p = number(p, pend, res->flags, num_spec);
*p++ = ']';
*p = 0;