[PATCH 2/2] sgiioc4: use ide_host_add()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 at it, stop the needless copying of the 'sgiioc4_port_info' variable.

Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>

---
This patch is against the recent pata-2.6 series...
                                         
 drivers/ide/pci/sgiioc4.c |   12 +-----------
 1 files changed, 1 insertion(+), 11 deletions(-)

Index: linux-2.6/drivers/ide/pci/sgiioc4.c
===================================================================
--- linux-2.6.orig/drivers/ide/pci/sgiioc4.c
+++ linux-2.6/drivers/ide/pci/sgiioc4.c
@@ -567,9 +567,7 @@ sgiioc4_ide_setup_pci_device(struct pci_
 	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,18 +602,10 @@ sgiioc4_ide_setup_pci_device(struct pci_
 	/* 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 alloc_error;
-	}
-
-	rc = ide_host_register(host, &d, hws);
+	rc = ide_host_add(&sgiioc4_port_info, hws, NULL);
 	if (!rc)
 		return 0;
 
-	ide_host_free(host);
- alloc_error:
 	release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE);
  request_error:
 	iounmap(virt_base);

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux