diff options
-rw-r--r-- | drivers/ide/ide-probe.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index ba16ade15c8c..d37a2680ceed 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1537,18 +1537,15 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) | |||
1537 | continue; | 1537 | continue; |
1538 | } | 1538 | } |
1539 | 1539 | ||
1540 | if (ide_probe_port(hwif) < 0) { | 1540 | if (ide_probe_port(hwif) == 0) |
1541 | ide_hwif_release_regions(hwif); | 1541 | hwif->present = 1; |
1542 | continue; | ||
1543 | } | ||
1544 | |||
1545 | hwif->present = 1; | ||
1546 | 1542 | ||
1547 | if (hwif->chipset != ide_4drives || !hwif->mate || | 1543 | if (hwif->chipset != ide_4drives || !hwif->mate || |
1548 | !hwif->mate->present) | 1544 | !hwif->mate->present) |
1549 | ide_register_port(hwif); | 1545 | ide_register_port(hwif); |
1550 | 1546 | ||
1551 | ide_port_tune_devices(hwif); | 1547 | if (hwif->present) |
1548 | ide_port_tune_devices(hwif); | ||
1552 | } | 1549 | } |
1553 | 1550 | ||
1554 | for (i = 0; i < MAX_HWIFS; i++) { | 1551 | for (i = 0; i < MAX_HWIFS; i++) { |
@@ -1557,9 +1554,6 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) | |||
1557 | 1554 | ||
1558 | hwif = &ide_hwifs[idx[i]]; | 1555 | hwif = &ide_hwifs[idx[i]]; |
1559 | 1556 | ||
1560 | if (!hwif->present) | ||
1561 | continue; | ||
1562 | |||
1563 | if (hwif_init(hwif) == 0) { | 1557 | if (hwif_init(hwif) == 0) { |
1564 | printk(KERN_INFO "%s: failed to initialize IDE " | 1558 | printk(KERN_INFO "%s: failed to initialize IDE " |
1565 | "interface\n", hwif->name); | 1559 | "interface\n", hwif->name); |
@@ -1568,10 +1562,13 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) | |||
1568 | continue; | 1562 | continue; |
1569 | } | 1563 | } |
1570 | 1564 | ||
1571 | ide_port_setup_devices(hwif); | 1565 | if (hwif->present) |
1566 | ide_port_setup_devices(hwif); | ||
1572 | 1567 | ||
1573 | ide_acpi_init(hwif); | 1568 | ide_acpi_init(hwif); |
1574 | ide_acpi_port_init_devices(hwif); | 1569 | |
1570 | if (hwif->present) | ||
1571 | ide_acpi_port_init_devices(hwif); | ||
1575 | } | 1572 | } |
1576 | 1573 | ||
1577 | for (i = 0; i < MAX_HWIFS; i++) { | 1574 | for (i = 0; i < MAX_HWIFS; i++) { |
@@ -1580,11 +1577,11 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) | |||
1580 | 1577 | ||
1581 | hwif = &ide_hwifs[idx[i]]; | 1578 | hwif = &ide_hwifs[idx[i]]; |
1582 | 1579 | ||
1583 | if (hwif->present) { | 1580 | if (hwif->chipset == ide_unknown) |
1584 | if (hwif->chipset == ide_unknown) | 1581 | hwif->chipset = ide_generic; |
1585 | hwif->chipset = ide_generic; | 1582 | |
1583 | if (hwif->present) | ||
1586 | hwif_register_devices(hwif); | 1584 | hwif_register_devices(hwif); |
1587 | } | ||
1588 | } | 1585 | } |
1589 | 1586 | ||
1590 | for (i = 0; i < MAX_HWIFS; i++) { | 1587 | for (i = 0; i < MAX_HWIFS; i++) { |
@@ -1593,11 +1590,11 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d) | |||
1593 | 1590 | ||
1594 | hwif = &ide_hwifs[idx[i]]; | 1591 | hwif = &ide_hwifs[idx[i]]; |
1595 | 1592 | ||
1596 | if (hwif->present) { | 1593 | ide_sysfs_register_port(hwif); |
1597 | ide_sysfs_register_port(hwif); | 1594 | ide_proc_register_port(hwif); |
1598 | ide_proc_register_port(hwif); | 1595 | |
1596 | if (hwif->present) | ||
1599 | ide_proc_port_register_devices(hwif); | 1597 | ide_proc_port_register_devices(hwif); |
1600 | } | ||
1601 | } | 1598 | } |
1602 | 1599 | ||
1603 | return rc; | 1600 | return rc; |