aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/scc_pata.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:57 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:57 -0400
commit6f904d015262dfa43eb1cecc00b0998b4c3543f2 (patch)
treed12a5818072d04525db6eb2d74668ba03bdead2d /drivers/ide/pci/scc_pata.c
parent48c3c1072651922ed153bcf0a33ea82cf20df390 (diff)
ide: add ide_host_add() helper
Add ide_host_add() helper which does ide_host_alloc()+ide_host_register(), then convert ide_setup_pci_device[s](), ide_legacy_device_add() and some host drivers to use it. While at it: * Fix ide_setup_pci_device[s](), ide_arm.c, gayle.c, ide-4drives.c, macide.c, q40ide.c, cmd640.c and cs5520.c to return correct error value. * -ENOENT -> -ENOMEM in rapide.c, ide-h8300.c, ide-generic.c, au1xxx-ide.c and pmac.c * -ENODEV -> -ENOMEM in palm_bk3710.c, ide_platform.c and delkin_cb.c * -1 -> -ENOMEM in ide-pnp.c Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/scc_pata.c')
-rw-r--r--drivers/ide/pci/scc_pata.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index d5e2ba6bacd6..94a7ab864236 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -588,7 +588,7 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev,
588 struct scc_ports *ports = pci_get_drvdata(dev); 588 struct scc_ports *ports = pci_get_drvdata(dev);
589 struct ide_host *host; 589 struct ide_host *host;
590 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 590 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
591 int i; 591 int i, rc;
592 592
593 memset(&hw, 0, sizeof(hw)); 593 memset(&hw, 0, sizeof(hw));
594 for (i = 0; i <= 8; i++) 594 for (i = 0; i <= 8; i++)
@@ -597,11 +597,9 @@ static int scc_ide_setup_pci_device(struct pci_dev *dev,
597 hw.dev = &dev->dev; 597 hw.dev = &dev->dev;
598 hw.chipset = ide_pci; 598 hw.chipset = ide_pci;
599 599
600 host = ide_host_alloc(d, hws); 600 rc = ide_host_add(d, hws, &host);
601 if (host == NULL) 601 if (rc)
602 return -ENOMEM; 602 return rc;
603
604 ide_host_register(host, d, hws);
605 603
606 ports->host = host; 604 ports->host = host;
607 605