aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/eisa
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/eisa')
-rw-r--r--drivers/eisa/eisa-bus.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 1b86fe0c2e80..612afeaec3cb 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -277,11 +277,13 @@ static int __init eisa_request_resources(struct eisa_root_device *root,
277 } 277 }
278 278
279 if (slot) { 279 if (slot) {
280 edev->res[i].name = NULL;
280 edev->res[i].start = SLOT_ADDRESS(root, slot) 281 edev->res[i].start = SLOT_ADDRESS(root, slot)
281 + (i * 0x400); 282 + (i * 0x400);
282 edev->res[i].end = edev->res[i].start + 0xff; 283 edev->res[i].end = edev->res[i].start + 0xff;
283 edev->res[i].flags = IORESOURCE_IO; 284 edev->res[i].flags = IORESOURCE_IO;
284 } else { 285 } else {
286 edev->res[i].name = NULL;
285 edev->res[i].start = SLOT_ADDRESS(root, slot) 287 edev->res[i].start = SLOT_ADDRESS(root, slot)
286 + EISA_VENDOR_ID_OFFSET; 288 + EISA_VENDOR_ID_OFFSET;
287 edev->res[i].end = edev->res[i].start + 3; 289 edev->res[i].end = edev->res[i].start + 3;
@@ -327,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)
327 return -ENOMEM; 329 return -ENOMEM;
328 } 330 }
329 331
330 if (eisa_init_device(root, edev, 0)) { 332 if (eisa_request_resources(root, edev, 0)) {
333 dev_warn(root->dev,
334 "EISA: Cannot allocate resource for mainboard\n");
331 kfree(edev); 335 kfree(edev);
332 if (!root->force_probe) 336 if (!root->force_probe)
333 return -ENODEV; 337 return -EBUSY;
334 goto force_probe; 338 goto force_probe;
335 } 339 }
336 340
337 if (eisa_request_resources(root, edev, 0)) { 341 if (eisa_init_device(root, edev, 0)) {
338 dev_warn(root->dev, 342 eisa_release_resources(edev);
339 "EISA: Cannot allocate resource for mainboard\n");
340 kfree(edev); 343 kfree(edev);
341 if (!root->force_probe) 344 if (!root->force_probe)
342 return -EBUSY; 345 return -ENODEV;
343 goto force_probe; 346 goto force_probe;
344 } 347 }
345 348
@@ -362,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)
362 continue; 365 continue;
363 } 366 }
364 367
365 if (eisa_init_device(root, edev, i)) {
366 kfree(edev);
367 continue;
368 }
369
370 if (eisa_request_resources(root, edev, i)) { 368 if (eisa_request_resources(root, edev, i)) {
371 dev_warn(root->dev, 369 dev_warn(root->dev,
372 "Cannot allocate resource for EISA slot %d\n", 370 "Cannot allocate resource for EISA slot %d\n",
@@ -375,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)
375 continue; 373 continue;
376 } 374 }
377 375
376 if (eisa_init_device(root, edev, i)) {
377 eisa_release_resources(edev);
378 kfree(edev);
379 continue;
380 }
381
378 if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED)) 382 if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED))
379 enabled_str = " (forced enabled)"; 383 enabled_str = " (forced enabled)";
380 else if (edev->state == EISA_CONFIG_FORCED) 384 else if (edev->state == EISA_CONFIG_FORCED)