diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2008-10-23 23:22:06 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-23 23:22:06 +0200 |
commit | 95a84cd19224e7d41934d261b568dd04bf2bda3e (patch) | |
tree | 3cafc0ff7a35fcd15352884de73c988cd0714f8b | |
parent | 3059ef99a167da6d5d77701fda5b905d985e31af (diff) | |
download | kernel_samsung_aries-95a84cd19224e7d41934d261b568dd04bf2bda3e.zip kernel_samsung_aries-95a84cd19224e7d41934d261b568dd04bf2bda3e.tar.gz kernel_samsung_aries-95a84cd19224e7d41934d261b568dd04bf2bda3e.tar.bz2 |
sgiioc4: use ide_host_add() (take 2)
Convert the driver to use ide_host_add() -- this seems to be a straightforward
change which I'm not sure why hasn't been done yet...
While doing this at last, get rid of:
- useless local copy of the 'sgiioc4_port_info' variable;
- unnecessary 'goto' and label...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: jeremy@sgi.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-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 9fadea4..d0cd670 100644 --- a/drivers/ide/sgiioc4.c +++ b/drivers/ide/sgiioc4.c @@ -567,9 +567,7 @@ 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 */ @@ -604,20 +602,10 @@ 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); |