diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:44 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:44 -0400 |
commit | ce30e4015954e281f682aa8d158a47885d8e1262 (patch) | |
tree | 53ab82a75db60bc73c7a990c914eaedb71f1febb | |
parent | cb8ea0929c9cb899d61c4e155aace0b34d8cffe3 (diff) |
sgiioc4: call ide_find_port_slot() later
Move ide_find_port_slot() call closer to ide_device_add().
This is basically a preparation for the future changes.
Cc: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index be73acb2080d..c79ff5b41088 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -588,10 +588,6 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
588 | hw_regs_t hw; | 588 | hw_regs_t hw; |
589 | struct ide_port_info d = sgiioc4_port_info; | 589 | struct ide_port_info d = sgiioc4_port_info; |
590 | 590 | ||
591 | hwif = ide_find_port_slot(&d); | ||
592 | if (hwif == NULL) | ||
593 | return -ENOMEM; | ||
594 | |||
595 | /* Get the CmdBlk and CtrlBlk Base Registers */ | 591 | /* Get the CmdBlk and CtrlBlk Base Registers */ |
596 | bar0 = pci_resource_start(dev, 0); | 592 | bar0 = pci_resource_start(dev, 0); |
597 | virt_base = ioremap(bar0, pci_resource_len(dev, 0)); | 593 | virt_base = ioremap(bar0, pci_resource_len(dev, 0)); |
@@ -621,6 +617,11 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
621 | hw.irq = dev->irq; | 617 | hw.irq = dev->irq; |
622 | hw.chipset = ide_pci; | 618 | hw.chipset = ide_pci; |
623 | hw.dev = &dev->dev; | 619 | hw.dev = &dev->dev; |
620 | |||
621 | hwif = ide_find_port_slot(&d); | ||
622 | if (hwif == NULL) | ||
623 | goto err; | ||
624 | |||
624 | ide_init_port_hw(hwif, &hw); | 625 | ide_init_port_hw(hwif, &hw); |
625 | 626 | ||
626 | /* The IOC4 uses MMIO rather than Port IO. */ | 627 | /* The IOC4 uses MMIO rather than Port IO. */ |
@@ -637,6 +638,10 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
637 | return -EIO; | 638 | return -EIO; |
638 | 639 | ||
639 | return 0; | 640 | return 0; |
641 | err: | ||
642 | release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE); | ||
643 | iounmap(virt_base); | ||
644 | return -ENOMEM; | ||
640 | } | 645 | } |
641 | 646 | ||
642 | static unsigned int __devinit | 647 | static unsigned int __devinit |