aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/arm/ide_arm.c7
-rw-r--r--drivers/ide/arm/palm_bk3710.c10
-rw-r--r--drivers/ide/arm/rapide.c8
-rw-r--r--drivers/ide/h8300/ide-h8300.c9
-rw-r--r--drivers/ide/ide-generic.c11
-rw-r--r--drivers/ide/ide-pnp.c16
-rw-r--r--drivers/ide/ide-probe.c27
-rw-r--r--drivers/ide/legacy/buddha.c5
-rw-r--r--drivers/ide/legacy/gayle.c7
-rw-r--r--drivers/ide/legacy/ide-4drives.c7
-rw-r--r--drivers/ide/legacy/ide-cs.c8
-rw-r--r--drivers/ide/legacy/ide_platform.c8
-rw-r--r--drivers/ide/legacy/macide.c7
-rw-r--r--drivers/ide/legacy/q40ide.c7
-rw-r--r--drivers/ide/mips/au1xxx-ide.c8
-rw-r--r--drivers/ide/mips/swarm.c10
-rw-r--r--drivers/ide/pci/cmd640.c7
-rw-r--r--drivers/ide/pci/cs5520.c7
-rw-r--r--drivers/ide/pci/delkin_cb.c8
-rw-r--r--drivers/ide/pci/scc_pata.c10
-rw-r--r--drivers/ide/ppc/pmac.c9
-rw-r--r--drivers/ide/setup-pci.c10
22 files changed, 70 insertions, 136 deletions
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
index 9efd7a86db45..176532ffae0e 100644
--- a/drivers/ide/arm/ide_arm.c
+++ b/drivers/ide/arm/ide_arm.c
@@ -28,7 +28,6 @@
28 28
29static int __init ide_arm_init(void) 29static int __init ide_arm_init(void)
30{ 30{
31 struct ide_host *host;
32 unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206; 31 unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206;
33 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 32 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
34 33
@@ -50,11 +49,7 @@ static int __init ide_arm_init(void)
50 hw.irq = IDE_ARM_IRQ; 49 hw.irq = IDE_ARM_IRQ;
51 hw.chipset = ide_generic; 50 hw.chipset = ide_generic;
52 51
53 host = ide_host_alloc(NULL, hws); 52 return ide_host_add(NULL, hws, NULL);
54 if (host)
55 ide_host_register(host, NULL, hws);
56
57 return 0;
58} 53}
59 54
60module_init(ide_arm_init); 55module_init(ide_arm_init);
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 24389a571c37..65bb4b8fd570 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -349,7 +349,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
349 struct resource *mem, *irq; 349 struct resource *mem, *irq;
350 struct ide_host *host; 350 struct ide_host *host;
351 unsigned long base, rate; 351 unsigned long base, rate;
352 int i; 352 int i, rc;
353 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 353 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
354 354
355 clk = clk_get(NULL, "IDECLK"); 355 clk = clk_get(NULL, "IDECLK");
@@ -392,16 +392,14 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
392 hw.irq = irq->start; 392 hw.irq = irq->start;
393 hw.chipset = ide_palm3710; 393 hw.chipset = ide_palm3710;
394 394
395 host = ide_host_alloc(&palm_bk3710_port_info, hws); 395 rc = ide_host_add(&palm_bk3710_port_info, hws, NULL);
396 if (host == NULL) 396 if (rc)
397 goto out; 397 goto out;
398 398
399 ide_host_register(host, &palm_bk3710_port_info, hws);
400
401 return 0; 399 return 0;
402out: 400out:
403 printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n"); 401 printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
404 return -ENODEV; 402 return rc;
405} 403}
406 404
407/* work with hotplug and coldplug */ 405/* work with hotplug and coldplug */
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index 11f3307385de..2bdd8b734afb 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -52,13 +52,9 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
52 hw.chipset = ide_generic; 52 hw.chipset = ide_generic;
53 hw.dev = &ec->dev; 53 hw.dev = &ec->dev;
54 54
55 host = ide_host_alloc(&rapide_port_info, hws); 55 ret = ide_host_add(&rapide_port_info, hws, &host);
56 if (host == NULL) { 56 if (ret)
57 ret = -ENOENT;
58 goto release; 57 goto release;
59 }
60
61 ide_host_register(host, &rapide_port_info, hws);
62 58
63 ecard_set_drvdata(ec, host); 59 ecard_set_drvdata(ec, host);
64 goto out; 60 goto out;
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index 15f76690a48c..bde7a585f198 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -191,7 +191,6 @@ static const struct ide_port_info h8300_port_info = {
191 191
192static int __init h8300_ide_init(void) 192static int __init h8300_ide_init(void)
193{ 193{
194 struct ide_host *host;
195 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 194 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
196 195
197 printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n"); 196 printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n");
@@ -205,13 +204,7 @@ static int __init h8300_ide_init(void)
205 204
206 hw_setup(&hw); 205 hw_setup(&hw);
207 206
208 host = ide_host_alloc(&h8300_port_info, hws); 207 return ide_host_add(&h8300_port_info, hws, NULL);
209 if (host == NULL)
210 return -ENOENT;
211
212 ide_host_register(host, &h8300_port_info, hws);
213
214 return 0;
215 208
216out_busy: 209out_busy:
217 printk(KERN_ERR "ide-h8300: IDE I/F resource already used.\n"); 210 printk(KERN_ERR "ide-h8300: IDE I/F resource already used.\n");
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index e8818362eb46..a7082c28d06f 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -28,9 +28,8 @@ MODULE_PARM_DESC(probe_mask, "probe mask for legacy ISA IDE ports");
28 28
29static ssize_t store_add(struct class *cls, const char *buf, size_t n) 29static ssize_t store_add(struct class *cls, const char *buf, size_t n)
30{ 30{
31 struct ide_host *host;
32 unsigned int base, ctl; 31 unsigned int base, ctl;
33 int irq; 32 int irq, rc;
34 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 33 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
35 34
36 if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3) 35 if (sscanf(buf, "%x:%x:%d", &base, &ctl, &irq) != 3)
@@ -41,11 +40,9 @@ static ssize_t store_add(struct class *cls, const char *buf, size_t n)
41 hw.irq = irq; 40 hw.irq = irq;
42 hw.chipset = ide_generic; 41 hw.chipset = ide_generic;
43 42
44 host = ide_host_alloc(NULL, hws); 43 rc = ide_host_add(NULL, hws, NULL);
45 if (host == NULL) 44 if (rc)
46 return -ENOENT; 45 return rc;
47
48 ide_host_register(host, NULL, hws);
49 46
50 return n; 47 return n;
51}; 48};
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c
index 4458ca61897a..bac9b392b689 100644
--- a/drivers/ide/ide-pnp.c
+++ b/drivers/ide/ide-pnp.c
@@ -31,6 +31,7 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
31{ 31{
32 struct ide_host *host; 32 struct ide_host *host;
33 unsigned long base, ctl; 33 unsigned long base, ctl;
34 int rc;
34 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 35 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
35 36
36 printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n"); 37 printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n");
@@ -59,19 +60,18 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
59 hw.irq = pnp_irq(dev, 0); 60 hw.irq = pnp_irq(dev, 0);
60 hw.chipset = ide_generic; 61 hw.chipset = ide_generic;
61 62
62 host = ide_host_alloc(NULL, hws); 63 rc = ide_host_add(NULL, hws, &host);
63 if (host) { 64 if (rc)
64 pnp_set_drvdata(dev, host); 65 goto out;
65 66
66 ide_host_register(host, NULL, hws); 67 pnp_set_drvdata(dev, host);
67
68 return 0;
69 }
70 68
69 return 0;
70out:
71 release_region(ctl, 1); 71 release_region(ctl, 1);
72 release_region(base, 8); 72 release_region(base, 8);
73 73
74 return -1; 74 return rc;
75} 75}
76 76
77static void idepnp_remove(struct pnp_dev *dev) 77static void idepnp_remove(struct pnp_dev *dev)
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 84a89561ec0f..17a104b95d54 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1677,6 +1677,24 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
1677} 1677}
1678EXPORT_SYMBOL_GPL(ide_host_register); 1678EXPORT_SYMBOL_GPL(ide_host_register);
1679 1679
1680int ide_host_add(const struct ide_port_info *d, hw_regs_t **hws,
1681 struct ide_host **hostp)
1682{
1683 struct ide_host *host;
1684
1685 host = ide_host_alloc(d, hws);
1686 if (host == NULL)
1687 return -ENOMEM;
1688
1689 ide_host_register(host, d, hws);
1690
1691 if (hostp)
1692 *hostp = host;
1693
1694 return 0;
1695}
1696EXPORT_SYMBOL_GPL(ide_host_add);
1697
1680void ide_host_remove(struct ide_host *host) 1698void ide_host_remove(struct ide_host *host)
1681{ 1699{
1682 int i; 1700 int i;
@@ -1749,7 +1767,6 @@ static void ide_legacy_init_one(hw_regs_t **hws, hw_regs_t *hw,
1749 1767
1750int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config) 1768int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
1751{ 1769{
1752 struct ide_host *host;
1753 hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL }; 1770 hw_regs_t hw[2], *hws[] = { NULL, NULL, NULL, NULL };
1754 1771
1755 memset(&hw, 0, sizeof(hw)); 1772 memset(&hw, 0, sizeof(hw));
@@ -1762,12 +1779,6 @@ int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
1762 (d->host_flags & IDE_HFLAG_SINGLE)) 1779 (d->host_flags & IDE_HFLAG_SINGLE))
1763 return -ENOENT; 1780 return -ENOENT;
1764 1781
1765 host = ide_host_alloc(d, hws); 1782 return ide_host_add(d, hws, NULL);
1766 if (host == NULL)
1767 return -ENOMEM;
1768
1769 ide_host_register(host, d, hws);
1770
1771 return 0;
1772} 1783}
1773EXPORT_SYMBOL_GPL(ide_legacy_device_add); 1784EXPORT_SYMBOL_GPL(ide_legacy_device_add);
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index 2625667fab4c..7c2afa97f417 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -151,7 +151,6 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,
151static int __init buddha_init(void) 151static int __init buddha_init(void)
152{ 152{
153 struct zorro_dev *z = NULL; 153 struct zorro_dev *z = NULL;
154 struct ide_host *host;
155 u_long buddha_board = 0; 154 u_long buddha_board = 0;
156 BuddhaType type; 155 BuddhaType type;
157 int buddha_num_hwifs, i; 156 int buddha_num_hwifs, i;
@@ -226,9 +225,7 @@ fail_base2:
226 hws[i] = &hw[i]; 225 hws[i] = &hw[i];
227 } 226 }
228 227
229 host = ide_host_alloc(NULL, hws); 228 ide_host_add(NULL, hws, NULL);
230 if (host)
231 ide_host_register(host, NULL, hws);
232 } 229 }
233 230
234 return 0; 231 return 0;
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 13d22bded6b4..dd5c467d8dd0 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -127,7 +127,6 @@ static int __init gayle_init(void)
127 unsigned long phys_base, res_start, res_n; 127 unsigned long phys_base, res_start, res_n;
128 unsigned long base, ctrlport, irqport; 128 unsigned long base, ctrlport, irqport;
129 ide_ack_intr_t *ack_intr; 129 ide_ack_intr_t *ack_intr;
130 struct ide_host *host;
131 int a4000, i; 130 int a4000, i;
132 hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL }; 131 hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
133 132
@@ -180,11 +179,7 @@ found:
180 hws[i] = &hw[i]; 179 hws[i] = &hw[i];
181 } 180 }
182 181
183 host = ide_host_alloc(NULL, hws); 182 return ide_host_add(NULL, hws, NULL);
184 if (host)
185 ide_host_register(host, NULL, hws);
186
187 return 0;
188} 183}
189 184
190module_init(gayle_init); 185module_init(gayle_init);
diff --git a/drivers/ide/legacy/ide-4drives.c b/drivers/ide/legacy/ide-4drives.c
index 5935153ef2ad..c76d55de6996 100644
--- a/drivers/ide/legacy/ide-4drives.c
+++ b/drivers/ide/legacy/ide-4drives.c
@@ -28,7 +28,6 @@ static const struct ide_port_info ide_4drives_port_info = {
28 28
29static int __init ide_4drives_init(void) 29static int __init ide_4drives_init(void)
30{ 30{
31 struct ide_host *host;
32 unsigned long base = 0x1f0, ctl = 0x3f6; 31 unsigned long base = 0x1f0, ctl = 0x3f6;
33 hw_regs_t hw, *hws[] = { &hw, &hw, NULL, NULL }; 32 hw_regs_t hw, *hws[] = { &hw, &hw, NULL, NULL };
34 33
@@ -54,11 +53,7 @@ static int __init ide_4drives_init(void)
54 hw.irq = 14; 53 hw.irq = 14;
55 hw.chipset = ide_4drives; 54 hw.chipset = ide_4drives;
56 55
57 host = ide_host_alloc(&ide_4drives_port_info, hws); 56 return ide_host_add(&ide_4drives_port_info, hws, NULL);
58 if (host)
59 ide_host_register(host, &ide_4drives_port_info, hws);
60
61 return 0;
62} 57}
63 58
64module_init(ide_4drives_init); 59module_init(ide_4drives_init);
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 1a4b9e6887fa..21bfac137844 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -162,7 +162,7 @@ static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
162{ 162{
163 struct ide_host *host; 163 struct ide_host *host;
164 ide_hwif_t *hwif; 164 ide_hwif_t *hwif;
165 int i; 165 int i, rc;
166 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 166 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
167 167
168 if (!request_region(io, 8, DRV_NAME)) { 168 if (!request_region(io, 8, DRV_NAME)) {
@@ -184,12 +184,10 @@ static struct ide_host *idecs_register(unsigned long io, unsigned long ctl,
184 hw.chipset = ide_pci; 184 hw.chipset = ide_pci;
185 hw.dev = &handle->dev; 185 hw.dev = &handle->dev;
186 186
187 host = ide_host_alloc(&idecs_port_info, hws); 187 rc = ide_host_add(&idecs_port_info, hws, &host);
188 if (host == NULL) 188 if (rc)
189 goto out_release; 189 goto out_release;
190 190
191 ide_host_register(host, &idecs_port_info, hws);
192
193 hwif = host->ports[0]; 191 hwif = host->ports[0];
194 192
195 if (hwif->present) 193 if (hwif->present)
diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c
index 58a942c6a131..051b4ab0f359 100644
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -99,13 +99,9 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
99 if (mmio) 99 if (mmio)
100 d.host_flags |= IDE_HFLAG_MMIO; 100 d.host_flags |= IDE_HFLAG_MMIO;
101 101
102 host = ide_host_alloc(&d, hws); 102 ret = ide_host_add(&d, hws, &host);
103 if (host == NULL) { 103 if (ret)
104 ret = -ENODEV;
105 goto out; 104 goto out;
106 }
107
108 ide_host_register(host, &d, hws);
109 105
110 platform_set_drvdata(pdev, host); 106 platform_set_drvdata(pdev, host);
111 107
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index b49cf8c2b91a..a0bb167980e7 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -92,7 +92,6 @@ static const char *mac_ide_name[] =
92static int __init macide_init(void) 92static int __init macide_init(void)
93{ 93{
94 ide_ack_intr_t *ack_intr; 94 ide_ack_intr_t *ack_intr;
95 struct ide_host *host;
96 unsigned long base; 95 unsigned long base;
97 int irq; 96 int irq;
98 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 97 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
@@ -125,11 +124,7 @@ static int __init macide_init(void)
125 124
126 macide_setup_ports(&hw, base, irq, ack_intr); 125 macide_setup_ports(&hw, base, irq, ack_intr);
127 126
128 host = ide_host_alloc(NULL, hws); 127 return ide_host_add(NULL, hws, NULL);
129 if (host)
130 ide_host_register(host, NULL, hws);
131
132 return 0;
133} 128}
134 129
135module_init(macide_init); 130module_init(macide_init);
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 8fb4438a6afd..4abd8fc78197 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -131,7 +131,6 @@ static const char *q40_ide_names[Q40IDE_NUM_HWIFS]={
131 131
132static int __init q40ide_init(void) 132static int __init q40ide_init(void)
133{ 133{
134 struct ide_host *host;
135 int i; 134 int i;
136 hw_regs_t hw[Q40IDE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL }; 135 hw_regs_t hw[Q40IDE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
137 136
@@ -160,11 +159,7 @@ static int __init q40ide_init(void)
160 hws[i] = &hw[i]; 159 hws[i] = &hw[i];
161 } 160 }
162 161
163 host = ide_host_alloc(&q40ide_port_info, hws); 162 return ide_host_add(&q40ide_port_info, hws, NULL);
164 if (host)
165 ide_host_register(host, &q40ide_port_info, hws);
166
167 return 0;
168} 163}
169 164
170module_init(q40ide_init); 165module_init(q40ide_init);
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 903c628bddd0..11b7f61aae40 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -609,13 +609,9 @@ static int au_ide_probe(struct device *dev)
609 hw.dev = dev; 609 hw.dev = dev;
610 hw.chipset = ide_au1xxx; 610 hw.chipset = ide_au1xxx;
611 611
612 host = ide_host_alloc(&au1xxx_port_info, hws); 612 ret = ide_host_add(&au1xxx_port_info, hws, &host);
613 if (host == NULL) { 613 if (ret)
614 ret = -ENOENT;
615 goto out; 614 goto out;
616 }
617
618 ide_host_register(host, &au1xxx_port_info, hws);
619 615
620 auide_hwif.hwif = host->ports[0]; 616 auide_hwif.hwif = host->ports[0];
621 617
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c
index b12d9d224831..badf79fc9e3a 100644
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -75,7 +75,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
75 u8 __iomem *base; 75 u8 __iomem *base;
76 struct ide_host *host; 76 struct ide_host *host;
77 phys_t offset, size; 77 phys_t offset, size;
78 int i; 78 int i, rc;
79 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; 79 hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
80 80
81 if (!SIBYTE_HAVE_IDE) 81 if (!SIBYTE_HAVE_IDE)
@@ -115,19 +115,17 @@ static int __devinit swarm_ide_probe(struct device *dev)
115 hw.irq = K_INT_GB_IDE; 115 hw.irq = K_INT_GB_IDE;
116 hw.chipset = ide_generic; 116 hw.chipset = ide_generic;
117 117
118 host = ide_host_alloc(&swarm_port_info, hws); 118 rc = ide_host_add(&swarm_port_info, hws, &host);
119 if (host == NULL) 119 if (rc)
120 goto err; 120 goto err;
121 121
122 ide_host_register(host, &swarm_port_info, hws);
123
124 dev_set_drvdata(dev, host); 122 dev_set_drvdata(dev, host);
125 123
126 return 0; 124 return 0;
127err: 125err:
128 release_resource(&swarm_ide_resource); 126 release_resource(&swarm_ide_resource);
129 iounmap(base); 127 iounmap(base);
130 return -ENOMEM; 128 return rc;
131} 129}
132 130
133static struct device_driver swarm_ide_driver = { 131static struct device_driver swarm_ide_driver = {
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index 013697b8cef4..e6c62006ca1a 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -709,7 +709,6 @@ static int cmd640x_init_one(unsigned long base, unsigned long ctl)
709 */ 709 */
710static int __init cmd640x_init(void) 710static int __init cmd640x_init(void)
711{ 711{
712 struct ide_host *host;
713 int second_port_cmd640 = 0, rc; 712 int second_port_cmd640 = 0, rc;
714 const char *bus_type, *port2; 713 const char *bus_type, *port2;
715 u8 b, cfr; 714 u8 b, cfr;
@@ -829,11 +828,7 @@ static int __init cmd640x_init(void)
829 cmd640_dump_regs(); 828 cmd640_dump_regs();
830#endif 829#endif
831 830
832 host = ide_host_alloc(&cmd640_port_info, hws); 831 return ide_host_add(&cmd640_port_info, hws, NULL);
833 if (host)
834 ide_host_register(host, &cmd640_port_info, hws);
835
836 return 1;
837} 832}
838 833
839module_param_named(probe_vlb, cmd640_vlb, bool, 0); 834module_param_named(probe_vlb, cmd640_vlb, bool, 0);
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[] = {
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c
index 5eb9d9325184..f84bfb4f600f 100644
--- a/drivers/ide/pci/delkin_cb.c
+++ b/drivers/ide/pci/delkin_cb.c
@@ -86,12 +86,10 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
86 hw.dev = &dev->dev; 86 hw.dev = &dev->dev;
87 hw.chipset = ide_pci; /* this enables IRQ sharing */ 87 hw.chipset = ide_pci; /* this enables IRQ sharing */
88 88
89 host = ide_host_alloc(&delkin_cb_port_info, hws); 89 rc = ide_host_add(&delkin_cb_port_info, hws, &host);
90 if (host == NULL) 90 if (rc)
91 goto out_disable; 91 goto out_disable;
92 92
93 ide_host_register(host, &delkin_cb_port_info, hws);
94
95 pci_set_drvdata(dev, host); 93 pci_set_drvdata(dev, host);
96 94
97 return 0; 95 return 0;
@@ -99,7 +97,7 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id)
99out_disable: 97out_disable:
100 pci_release_regions(dev); 98 pci_release_regions(dev);
101 pci_disable_device(dev); 99 pci_disable_device(dev);
102 return -ENODEV; 100 return rc;
103} 101}
104 102
105static void 103static void
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
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index ecd2f28da1ba..c521bf6e1bf2 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1043,6 +1043,7 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
1043 ide_hwif_t *hwif; 1043 ide_hwif_t *hwif;
1044 hw_regs_t *hws[] = { hw, NULL, NULL, NULL }; 1044 hw_regs_t *hws[] = { hw, NULL, NULL, NULL };
1045 struct ide_port_info d = pmac_port_info; 1045 struct ide_port_info d = pmac_port_info;
1046 int rc;
1046 1047
1047 pmif->broken_dma = pmif->broken_dma_warn = 0; 1048 pmif->broken_dma = pmif->broken_dma_warn = 0;
1048 if (of_device_is_compatible(np, "shasta-ata")) { 1049 if (of_device_is_compatible(np, "shasta-ata")) {
@@ -1118,11 +1119,9 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
1118 pmif->mdev ? "macio" : "PCI", pmif->aapl_bus_id, 1119 pmif->mdev ? "macio" : "PCI", pmif->aapl_bus_id,
1119 pmif->mediabay ? " (mediabay)" : "", hw->irq); 1120 pmif->mediabay ? " (mediabay)" : "", hw->irq);
1120 1121
1121 host = ide_host_alloc(&d, hws); 1122 rc = ide_host_add(&d, hws, &host);
1122 if (host == NULL) 1123 if (rc)
1123 return -ENOENT; 1124 return rc;
1124
1125 ide_host_register(host, &d, hws);
1126 1125
1127 hwif = host->ports[0]; 1126 hwif = host->ports[0];
1128 1127
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 1c0c5570dec8..b15cad58dc81 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -541,7 +541,6 @@ out:
541 541
542int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d) 542int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
543{ 543{
544 struct ide_host *host;
545 hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL }; 544 hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
546 int ret; 545 int ret;
547 546
@@ -551,9 +550,7 @@ int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
551 /* FIXME: silent failure can happen */ 550 /* FIXME: silent failure can happen */
552 ide_pci_setup_ports(dev, d, ret, &hw[0], &hws[0]); 551 ide_pci_setup_ports(dev, d, ret, &hw[0], &hws[0]);
553 552
554 host = ide_host_alloc(d, hws); 553 ret = ide_host_add(d, hws, NULL);
555 if (host)
556 ide_host_register(host, d, hws);
557 } 554 }
558 555
559 return ret; 556 return ret;
@@ -564,7 +561,6 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
564 const struct ide_port_info *d) 561 const struct ide_port_info *d)
565{ 562{
566 struct pci_dev *pdev[] = { dev1, dev2 }; 563 struct pci_dev *pdev[] = { dev1, dev2 };
567 struct ide_host *host;
568 int ret, i; 564 int ret, i;
569 hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL }; 565 hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL };
570 566
@@ -582,9 +578,7 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
582 ide_pci_setup_ports(pdev[i], d, ret, &hw[i*2], &hws[i*2]); 578 ide_pci_setup_ports(pdev[i], d, ret, &hw[i*2], &hws[i*2]);
583 } 579 }
584 580
585 host = ide_host_alloc(d, hws); 581 ret = ide_host_add(d, hws, NULL);
586 if (host)
587 ide_host_register(host, d, hws);
588out: 582out:
589 return ret; 583 return ret;
590} 584}