aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/eisa/eisa-bus.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 8842cde69177..612afeaec3cb 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -277,18 +277,19 @@ 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;
288 edev->res[i].flags = IORESOURCE_IO | IORESOURCE_BUSY; 290 edev->res[i].flags = IORESOURCE_IO | IORESOURCE_BUSY;
289 } 291 }
290 292
291 dev_printk(KERN_DEBUG, &edev->dev, "%pR\n", &edev->res[i]);
292 if (request_resource(root->res, &edev->res[i])) 293 if (request_resource(root->res, &edev->res[i]))
293 goto failed; 294 goto failed;
294 } 295 }
@@ -328,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)
328 return -ENOMEM; 329 return -ENOMEM;
329 } 330 }
330 331
331 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");
332 kfree(edev); 335 kfree(edev);
333 if (!root->force_probe) 336 if (!root->force_probe)
334 return -ENODEV; 337 return -EBUSY;
335 goto force_probe; 338 goto force_probe;
336 } 339 }
337 340
338 if (eisa_request_resources(root, edev, 0)) { 341 if (eisa_init_device(root, edev, 0)) {
339 dev_warn(root->dev, 342 eisa_release_resources(edev);
340 "EISA: Cannot allocate resource for mainboard\n");
341 kfree(edev); 343 kfree(edev);
342 if (!root->force_probe) 344 if (!root->force_probe)
343 return -EBUSY; 345 return -ENODEV;
344 goto force_probe; 346 goto force_probe;
345 } 347 }
346 348
@@ -363,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)
363 continue; 365 continue;
364 } 366 }
365 367
366 if (eisa_init_device(root, edev, i)) {
367 kfree(edev);
368 continue;
369 }
370
371 if (eisa_request_resources(root, edev, i)) { 368 if (eisa_request_resources(root, edev, i)) {
372 dev_warn(root->dev, 369 dev_warn(root->dev,
373 "Cannot allocate resource for EISA slot %d\n", 370 "Cannot allocate resource for EISA slot %d\n",
@@ -376,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)
376 continue; 373 continue;
377 } 374 }
378 375
376 if (eisa_init_device(root, edev, i)) {
377 eisa_release_resources(edev);
378 kfree(edev);
379 continue;
380 }
381
379 if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED)) 382 if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED))
380 enabled_str = " (forced enabled)"; 383 enabled_str = " (forced enabled)";
381 else if (edev->state == EISA_CONFIG_FORCED) 384 else if (edev->state == EISA_CONFIG_FORCED)