diff options
Diffstat (limited to 'drivers/ide/ide-probe.c')
| -rw-r--r-- | drivers/ide/ide-probe.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index d21e51a02c3e..235ebdb29b28 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
| @@ -39,6 +39,8 @@ | |||
| 39 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
| 40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
| 41 | 41 | ||
| 42 | static ide_hwif_t ide_hwifs[MAX_HWIFS]; /* master data repository */ | ||
| 43 | |||
| 42 | /** | 44 | /** |
| 43 | * generic_id - add a generic drive id | 45 | * generic_id - add a generic drive id |
| 44 | * @drive: drive to make an ID block for | 46 | * @drive: drive to make an ID block for |
| @@ -1318,10 +1320,10 @@ static void ide_port_init_devices(ide_hwif_t *hwif) | |||
| 1318 | drive->unmask = 1; | 1320 | drive->unmask = 1; |
| 1319 | if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS) | 1321 | if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS) |
| 1320 | drive->no_unmask = 1; | 1322 | drive->no_unmask = 1; |
| 1321 | } | ||
| 1322 | 1323 | ||
| 1323 | if (port_ops && port_ops->port_init_devs) | 1324 | if (port_ops && port_ops->init_dev) |
| 1324 | port_ops->port_init_devs(hwif); | 1325 | port_ops->init_dev(drive); |
| 1326 | } | ||
| 1325 | } | 1327 | } |
| 1326 | 1328 | ||
| 1327 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, | 1329 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, |
| @@ -1473,22 +1475,29 @@ ide_hwif_t *ide_find_port_slot(const struct ide_port_info *d) | |||
| 1473 | for (; i < MAX_HWIFS; i++) { | 1475 | for (; i < MAX_HWIFS; i++) { |
| 1474 | hwif = &ide_hwifs[i]; | 1476 | hwif = &ide_hwifs[i]; |
| 1475 | if (hwif->chipset == ide_unknown) | 1477 | if (hwif->chipset == ide_unknown) |
| 1476 | return hwif; | 1478 | goto out_found; |
| 1477 | } | 1479 | } |
| 1478 | } else { | 1480 | } else { |
| 1479 | for (i = 2; i < MAX_HWIFS; i++) { | 1481 | for (i = 2; i < MAX_HWIFS; i++) { |
| 1480 | hwif = &ide_hwifs[i]; | 1482 | hwif = &ide_hwifs[i]; |
| 1481 | if (hwif->chipset == ide_unknown) | 1483 | if (hwif->chipset == ide_unknown) |
| 1482 | return hwif; | 1484 | goto out_found; |
| 1483 | } | 1485 | } |
| 1484 | for (i = 0; i < 2 && i < MAX_HWIFS; i++) { | 1486 | for (i = 0; i < 2 && i < MAX_HWIFS; i++) { |
| 1485 | hwif = &ide_hwifs[i]; | 1487 | hwif = &ide_hwifs[i]; |
| 1486 | if (hwif->chipset == ide_unknown) | 1488 | if (hwif->chipset == ide_unknown) |
| 1487 | return hwif; | 1489 | goto out_found; |
| 1488 | } | 1490 | } |
| 1489 | } | 1491 | } |
| 1490 | 1492 | ||
| 1493 | printk(KERN_ERR "%s: no free slot for interface\n", | ||
| 1494 | d ? d->name : "ide"); | ||
| 1495 | |||
| 1491 | return NULL; | 1496 | return NULL; |
| 1497 | |||
| 1498 | out_found: | ||
| 1499 | ide_init_port_data(hwif, i); | ||
| 1500 | return hwif; | ||
| 1492 | } | 1501 | } |
| 1493 | EXPORT_SYMBOL_GPL(ide_find_port_slot); | 1502 | EXPORT_SYMBOL_GPL(ide_find_port_slot); |
| 1494 | 1503 | ||
