diff options
-rw-r--r-- | drivers/ide/sgiioc4.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c index 9fadea41e1c6..d0cd670f4545 100644 --- a/drivers/ide/sgiioc4.c +++ b/drivers/ide/sgiioc4.c | |||
@@ -567,9 +567,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
567 | unsigned long cmd_base, irqport; | 567 | unsigned long cmd_base, irqport; |
568 | unsigned long bar0, cmd_phys_base, ctl; | 568 | unsigned long bar0, cmd_phys_base, ctl; |
569 | void __iomem *virt_base; | 569 | void __iomem *virt_base; |
570 | struct ide_host *host; | ||
571 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | 570 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; |
572 | struct ide_port_info d = sgiioc4_port_info; | ||
573 | int rc; | 571 | int rc; |
574 | 572 | ||
575 | /* Get the CmdBlk and CtrlBlk Base Registers */ | 573 | /* Get the CmdBlk and CtrlBlk Base Registers */ |
@@ -604,20 +602,10 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev) | |||
604 | /* Initializing chipset IRQ Registers */ | 602 | /* Initializing chipset IRQ Registers */ |
605 | writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); | 603 | writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); |
606 | 604 | ||
607 | host = ide_host_alloc(&d, hws); | 605 | rc = ide_host_add(&sgiioc4_port_info, hws, NULL); |
608 | if (host == NULL) { | 606 | if (!rc) |
609 | rc = -ENOMEM; | 607 | return 0; |
610 | goto err; | ||
611 | } | ||
612 | |||
613 | rc = ide_host_register(host, &d, hws); | ||
614 | if (rc) | ||
615 | goto err_free; | ||
616 | 608 | ||
617 | return 0; | ||
618 | err_free: | ||
619 | ide_host_free(host); | ||
620 | err: | ||
621 | release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE); | 609 | release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE); |
622 | req_mem_rgn_err: | 610 | req_mem_rgn_err: |
623 | iounmap(virt_base); | 611 | iounmap(virt_base); |