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>

authored by Sergei Shtylyov and committed by Bartlomiej Zolnierkiewicz 95a84cd1 3059ef99

+3 -15
+3 -15
drivers/ide/sgiioc4.c
··· 567 unsigned long cmd_base, irqport; 568 unsigned long bar0, cmd_phys_base, ctl; 569 void __iomem *virt_base; 570 - struct ide_host *host; 571 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 572 - struct ide_port_info d = sgiioc4_port_info; 573 int rc; 574 575 /* Get the CmdBlk and CtrlBlk Base Registers */ ··· 602 /* Initializing chipset IRQ Registers */ 603 writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); 604 605 - host = ide_host_alloc(&d, hws); 606 - if (host == NULL) { 607 - rc = -ENOMEM; 608 - goto err; 609 - } 610 611 - rc = ide_host_register(host, &d, hws); 612 - if (rc) 613 - goto err_free; 614 - 615 - return 0; 616 - err_free: 617 - ide_host_free(host); 618 - err: 619 release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE); 620 req_mem_rgn_err: 621 iounmap(virt_base);
··· 567 unsigned long cmd_base, irqport; 568 unsigned long bar0, cmd_phys_base, ctl; 569 void __iomem *virt_base; 570 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 571 int rc; 572 573 /* Get the CmdBlk and CtrlBlk Base Registers */ ··· 604 /* Initializing chipset IRQ Registers */ 605 writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); 606 607 + rc = ide_host_add(&sgiioc4_port_info, hws, NULL); 608 + if (!rc) 609 + return 0; 610 611 release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE); 612 req_mem_rgn_err: 613 iounmap(virt_base);