summaryrefslogtreecommitdiff
path: root/drivers/ide/sgiioc4.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 16:08:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 16:08:11 -0700
commit969907a956752f88dde4aa23fa8c033b9a939aee (patch)
treee131db71d1db9a3b8591d718e8c5e897daadccec /drivers/ide/sgiioc4.c
parentea541686d8454efac4f2b5c0767affb12d4b6a52 (diff)
parentfa3fd7204e1a4e8538117f0edbfecd4132276860 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: ide: drivers/ide/generic.c -> drivers/ide/ide-pci-generic.c ide-disk: set non-rotational queue flag for SSD and CF devices ide-cd: add TEAC CD-224E to the NO_AUTOCLOSE list ide: Add tx4938ide driver (v2) TXx9: Add TX4938 ATA support (v3) ide: Add tx4939ide driver (v6) ide: two more pci_ioremap_bar() conversions pci: use pci_ioremap_bar() in drivers/ide sgiioc4: use ide_host_add() (take 2) sgiioc4: fix error cleanup path (take 2)
Diffstat (limited to 'drivers/ide/sgiioc4.c')
-rw-r--r--drivers/ide/sgiioc4.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/ide/sgiioc4.c b/drivers/ide/sgiioc4.c
index 8af9b23499fd..7defa0ae2014 100644
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -567,14 +567,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
unsigned long cmd_base, irqport;
unsigned long bar0, cmd_phys_base, ctl;
void __iomem *virt_base;
- struct ide_host *host;
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
- struct ide_port_info d = sgiioc4_port_info;
int rc;
/* Get the CmdBlk and CtrlBlk Base Registers */
bar0 = pci_resource_start(dev, 0);
- virt_base = ioremap(bar0, pci_resource_len(dev, 0));
+ virt_base = pci_ioremap_bar(dev, 0);
if (virt_base == NULL) {
printk(KERN_ERR "%s: Unable to remap BAR 0 address: 0x%lx\n",
DRV_NAME, bar0);
@@ -590,7 +588,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
printk(KERN_ERR "%s %s -- ERROR: addresses 0x%08lx to 0x%08lx "
"already in use\n", DRV_NAME, pci_name(dev),
cmd_phys_base, cmd_phys_base + IOC4_CMD_CTL_BLK_SIZE);
- return -EBUSY;
+ rc = -EBUSY;
+ goto req_mem_rgn_err;
}
/* Initialize the IO registers */
@@ -603,21 +602,12 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
/* Initializing chipset IRQ Registers */
writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4));
- host = ide_host_alloc(&d, hws);
- if (host == NULL) {
- rc = -ENOMEM;
- goto err;
- }
-
- rc = ide_host_register(host, &d, hws);
- if (rc)
- goto err_free;
+ rc = ide_host_add(&sgiioc4_port_info, hws, NULL);
+ if (!rc)
+ return 0;
- return 0;
-err_free:
- ide_host_free(host);
-err:
release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE);
+req_mem_rgn_err:
iounmap(virt_base);
return rc;
}