Skip to content

Commit

Permalink
Merge branch 'eisa' into next
Browse files Browse the repository at this point in the history
* eisa:
  Revert "EISA: Initialize device before its resources"
  Revert "EISA: Log device resources in dmesg"
  • Loading branch information
bjorn-helgaas committed Jan 18, 2014
2 parents 6e2d98d + 765ee51 commit cef09b8
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions drivers/eisa/eisa-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,18 +277,19 @@ static int __init eisa_request_resources(struct eisa_root_device *root,
}

if (slot) {
edev->res[i].name = NULL;
edev->res[i].start = SLOT_ADDRESS(root, slot)
+ (i * 0x400);
edev->res[i].end = edev->res[i].start + 0xff;
edev->res[i].flags = IORESOURCE_IO;
} else {
edev->res[i].name = NULL;
edev->res[i].start = SLOT_ADDRESS(root, slot)
+ EISA_VENDOR_ID_OFFSET;
edev->res[i].end = edev->res[i].start + 3;
edev->res[i].flags = IORESOURCE_IO | IORESOURCE_BUSY;
}

dev_printk(KERN_DEBUG, &edev->dev, "%pR\n", &edev->res[i]);
if (request_resource(root->res, &edev->res[i]))
goto failed;
}
Expand Down Expand Up @@ -328,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)
return -ENOMEM;
}

if (eisa_init_device(root, edev, 0)) {
if (eisa_request_resources(root, edev, 0)) {
dev_warn(root->dev,
"EISA: Cannot allocate resource for mainboard\n");
kfree(edev);
if (!root->force_probe)
return -ENODEV;
return -EBUSY;
goto force_probe;
}

if (eisa_request_resources(root, edev, 0)) {
dev_warn(root->dev,
"EISA: Cannot allocate resource for mainboard\n");
if (eisa_init_device(root, edev, 0)) {
eisa_release_resources(edev);
kfree(edev);
if (!root->force_probe)
return -EBUSY;
return -ENODEV;
goto force_probe;
}

Expand All @@ -363,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)
continue;
}

if (eisa_init_device(root, edev, i)) {
kfree(edev);
continue;
}

if (eisa_request_resources(root, edev, i)) {
dev_warn(root->dev,
"Cannot allocate resource for EISA slot %d\n",
Expand All @@ -376,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)
continue;
}

if (eisa_init_device(root, edev, i)) {
eisa_release_resources(edev);
kfree(edev);
continue;
}

if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED))
enabled_str = " (forced enabled)";
else if (edev->state == EISA_CONFIG_FORCED)
Expand Down

0 comments on commit cef09b8

Please sign in to comment.