* [PATCH 2/2] sgiioc4: use ide_host_add() (take 2)
@ 2008-10-20 13:24 Sergei Shtylyov
2008-10-23 19:29 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2008-10-20 13:24 UTC (permalink / raw)
To: bzolnier; +Cc: linux-ide, jeremy
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>
---
This patch is against the recent pata-2.6 series...
drivers/ide/pci/sgiioc4.c | 18 +++---------------
1 files changed, 3 insertions(+), 15 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,20 +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 err;
- }
+ rc = ide_host_add(&sgiioc4_port_info, hws, NULL);
+ if (!rc)
+ return 0;
- rc = ide_host_register(host, &d, hws);
- if (rc)
- goto err_free;
-
- 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-23 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20 13:24 [PATCH 2/2] sgiioc4: use ide_host_add() (take 2) Sergei Shtylyov
2008-10-23 19:29 ` Bartlomiej Zolnierkiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).