aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sgiioc4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/sgiioc4.c')
-rw-r--r--drivers/ide/pci/sgiioc4.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index af526b671c4e..4ee597d08797 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -622,12 +622,18 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
622 ide_hwif_t *hwif; 622 ide_hwif_t *hwif;
623 int h; 623 int h;
624 624
625 /*
626 * Find an empty HWIF; if none available, return -ENOMEM.
627 */
625 for (h = 0; h < MAX_HWIFS; ++h) { 628 for (h = 0; h < MAX_HWIFS; ++h) {
626 hwif = &ide_hwifs[h]; 629 hwif = &ide_hwifs[h];
627 /* Find an empty HWIF */
628 if (hwif->chipset == ide_unknown) 630 if (hwif->chipset == ide_unknown)
629 break; 631 break;
630 } 632 }
633 if (h == MAX_HWIFS) {
634 printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n", d->name);
635 return -ENOMEM;
636 }
631 637
632 /* Get the CmdBlk and CtrlBlk Base Registers */ 638 /* Get the CmdBlk and CtrlBlk Base Registers */
633 base = pci_resource_start(dev, 0) + IOC4_CMD_OFFSET; 639 base = pci_resource_start(dev, 0) + IOC4_CMD_OFFSET;