aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/cs5520.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/cs5520.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/cs5520.c')
-rw-r--r--drivers/ide/pci/cs5520.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index b8ec06d22c61..b03d8ae947e6 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -114,7 +114,6 @@ static const struct ide_port_info cyrix_chipsets[] __devinitdata = {
114 114
115static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) 115static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id)
116{ 116{
117 struct ide_host *host;
118 const struct ide_port_info *d = &cyrix_chipsets[id->driver_data]; 117 const struct ide_port_info *d = &cyrix_chipsets[id->driver_data];
119 hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL }; 118 hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
120 119
@@ -140,11 +139,7 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
140 139
141 ide_pci_setup_ports(dev, d, 14, &hw[0], &hws[0]); 140 ide_pci_setup_ports(dev, d, 14, &hw[0], &hws[0]);
142 141
143 host = ide_host_alloc(d, hws); 142 return ide_host_add(d, hws, NULL);
144 if (host)
145 ide_host_register(host, d, hws);
146
147 return 0;
148} 143}
149 144
150static const struct pci_device_id cs5520_pci_tbl[] = { 145static const struct pci_device_id cs5520_pci_tbl[] = {