aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/setup-pci.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 19:55:57 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 19:55:57 +0200
commit6f904d015262dfa43eb1cecc00b0998b4c3543f2 (patch)
treed12a5818072d04525db6eb2d74668ba03bdead2d /drivers/ide/setup-pci.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/setup-pci.c')
-rw-r--r--drivers/ide/setup-pci.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 1c0c5570dec..b15cad58dc8 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -541,7 +541,6 @@ out:
int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
{
- struct ide_host *host;
hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
int ret;
@@ -551,9 +550,7 @@ int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
/* FIXME: silent failure can happen */
ide_pci_setup_ports(dev, d, ret, &hw[0], &hws[0]);
- host = ide_host_alloc(d, hws);
- if (host)
- ide_host_register(host, d, hws);
+ ret = ide_host_add(d, hws, NULL);
}
return ret;
@@ -564,7 +561,6 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
const struct ide_port_info *d)
{
struct pci_dev *pdev[] = { dev1, dev2 };
- struct ide_host *host;
int ret, i;
hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
@@ -582,9 +578,7 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
ide_pci_setup_ports(pdev[i], d, ret, &hw[i*2], &hws[i*2]);
}
- host = ide_host_alloc(d, hws);
- if (host)
- ide_host_register(host, d, hws);
+ ret = ide_host_add(d, hws, NULL);
out:
return ret;
}