diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:39 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:39 -0400 |
commit | 256c5f8eef7b9a8c8a85c15c58cda9df455f947e (patch) | |
tree | cecc145a78f140de8e623b1563c4d758290e2ae8 /drivers | |
parent | 9ad540937554a3779c5fe7af13aa390b1d2aeb3e (diff) |
ide: fix hwif-s initialization
* Add ide_hwifs[] entry initialization to ide_find_port_slot()
and remove ide_init_port_data() calls from host drivers.
* Unexport ide_init_port_data().
* Remove no longer needed init_ide_data().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/arm/palm_bk3710.c | 1 | ||||
-rw-r--r-- | drivers/ide/h8300/ide-h8300.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide-pnp.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 10 | ||||
-rw-r--r-- | drivers/ide/ide.c | 15 | ||||
-rw-r--r-- | drivers/ide/legacy/buddha.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/falconide.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/gayle.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/ide-cs.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/macide.c | 1 | ||||
-rw-r--r-- | drivers/ide/legacy/q40ide.c | 1 | ||||
-rw-r--r-- | drivers/ide/pci/delkin_cb.c | 1 |
12 files changed, 7 insertions, 28 deletions
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c index 9b8a45d2cf17..c79b85b6e4a3 100644 --- a/drivers/ide/arm/palm_bk3710.c +++ b/drivers/ide/arm/palm_bk3710.c | |||
@@ -400,7 +400,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
400 | 400 | ||
401 | i = hwif->index; | 401 | i = hwif->index; |
402 | 402 | ||
403 | ide_init_port_data(hwif, i); | ||
404 | ide_init_port_hw(hwif, &hw); | 403 | ide_init_port_hw(hwif, &hw); |
405 | 404 | ||
406 | default_hwif_mmiops(hwif); | 405 | default_hwif_mmiops(hwif); |
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c index ae37ee58bae2..dfce105bae64 100644 --- a/drivers/ide/h8300/ide-h8300.c +++ b/drivers/ide/h8300/ide-h8300.c | |||
@@ -199,7 +199,6 @@ static int __init h8300_ide_init(void) | |||
199 | } | 199 | } |
200 | 200 | ||
201 | index = hwif->index; | 201 | index = hwif->index; |
202 | ide_init_port_data(hwif, index); | ||
203 | ide_init_port_hw(hwif, &hw); | 202 | ide_init_port_hw(hwif, &hw); |
204 | hwif_setup(hwif); | 203 | hwif_setup(hwif); |
205 | hwif->host_flags = IDE_HFLAG_NO_IO_32BIT; | 204 | hwif->host_flags = IDE_HFLAG_NO_IO_32BIT; |
diff --git a/drivers/ide/ide-pnp.c b/drivers/ide/ide-pnp.c index adbd01784162..fc1e10c9d1cd 100644 --- a/drivers/ide/ide-pnp.c +++ b/drivers/ide/ide-pnp.c | |||
@@ -62,7 +62,6 @@ static int idepnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) | |||
62 | u8 index = hwif->index; | 62 | u8 index = hwif->index; |
63 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; | 63 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; |
64 | 64 | ||
65 | ide_init_port_data(hwif, index); | ||
66 | ide_init_port_hw(hwif, &hw); | 65 | ide_init_port_hw(hwif, &hw); |
67 | 66 | ||
68 | printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); | 67 | printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index); |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index d21e51a02c3e..592d424412ea 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1473,22 +1473,26 @@ ide_hwif_t *ide_find_port_slot(const struct ide_port_info *d) | |||
1473 | for (; i < MAX_HWIFS; i++) { | 1473 | for (; i < MAX_HWIFS; i++) { |
1474 | hwif = &ide_hwifs[i]; | 1474 | hwif = &ide_hwifs[i]; |
1475 | if (hwif->chipset == ide_unknown) | 1475 | if (hwif->chipset == ide_unknown) |
1476 | return hwif; | 1476 | goto out_found; |
1477 | } | 1477 | } |
1478 | } else { | 1478 | } else { |
1479 | for (i = 2; i < MAX_HWIFS; i++) { | 1479 | for (i = 2; i < MAX_HWIFS; i++) { |
1480 | hwif = &ide_hwifs[i]; | 1480 | hwif = &ide_hwifs[i]; |
1481 | if (hwif->chipset == ide_unknown) | 1481 | if (hwif->chipset == ide_unknown) |
1482 | return hwif; | 1482 | goto out_found; |
1483 | } | 1483 | } |
1484 | for (i = 0; i < 2 && i < MAX_HWIFS; i++) { | 1484 | for (i = 0; i < 2 && i < MAX_HWIFS; i++) { |
1485 | hwif = &ide_hwifs[i]; | 1485 | hwif = &ide_hwifs[i]; |
1486 | if (hwif->chipset == ide_unknown) | 1486 | if (hwif->chipset == ide_unknown) |
1487 | return hwif; | 1487 | goto out_found; |
1488 | } | 1488 | } |
1489 | } | 1489 | } |
1490 | 1490 | ||
1491 | return NULL; | 1491 | return NULL; |
1492 | |||
1493 | out_found: | ||
1494 | ide_init_port_data(hwif, i); | ||
1495 | return hwif; | ||
1492 | } | 1496 | } |
1493 | EXPORT_SYMBOL_GPL(ide_find_port_slot); | 1497 | EXPORT_SYMBOL_GPL(ide_find_port_slot); |
1494 | 1498 | ||
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 2b8453510e09..32d8ee281d56 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -121,7 +121,6 @@ void ide_init_port_data(ide_hwif_t *hwif, unsigned int index) | |||
121 | 121 | ||
122 | ide_port_init_devices_data(hwif); | 122 | ide_port_init_devices_data(hwif); |
123 | } | 123 | } |
124 | EXPORT_SYMBOL_GPL(ide_init_port_data); | ||
125 | 124 | ||
126 | static void ide_port_init_devices_data(ide_hwif_t *hwif) | 125 | static void ide_port_init_devices_data(ide_hwif_t *hwif) |
127 | { | 126 | { |
@@ -150,18 +149,6 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif) | |||
150 | } | 149 | } |
151 | } | 150 | } |
152 | 151 | ||
153 | static void __init init_ide_data (void) | ||
154 | { | ||
155 | unsigned int index; | ||
156 | |||
157 | /* Initialise all interface structures */ | ||
158 | for (index = 0; index < MAX_HWIFS; ++index) { | ||
159 | ide_hwif_t *hwif = &ide_hwifs[index]; | ||
160 | |||
161 | ide_init_port_data(hwif, index); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) | 152 | void ide_remove_port_from_hwgroup(ide_hwif_t *hwif) |
166 | { | 153 | { |
167 | ide_hwgroup_t *hwgroup = hwif->hwgroup; | 154 | ide_hwgroup_t *hwgroup = hwif->hwgroup; |
@@ -1021,8 +1008,6 @@ static int __init ide_init(void) | |||
1021 | goto out_port_class; | 1008 | goto out_port_class; |
1022 | } | 1009 | } |
1023 | 1010 | ||
1024 | init_ide_data(); | ||
1025 | |||
1026 | proc_ide_create(); | 1011 | proc_ide_create(); |
1027 | 1012 | ||
1028 | return 0; | 1013 | return 0; |
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c index 9a1d27ef3f8a..0497e7f85b09 100644 --- a/drivers/ide/legacy/buddha.c +++ b/drivers/ide/legacy/buddha.c | |||
@@ -227,7 +227,6 @@ fail_base2: | |||
227 | if (hwif) { | 227 | if (hwif) { |
228 | u8 index = hwif->index; | 228 | u8 index = hwif->index; |
229 | 229 | ||
230 | ide_init_port_data(hwif, index); | ||
231 | ide_init_port_hw(hwif, &hw); | 230 | ide_init_port_hw(hwif, &hw); |
232 | 231 | ||
233 | idx[i] = index; | 232 | idx[i] = index; |
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index af11028b4794..129a812bb57f 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c | |||
@@ -111,7 +111,6 @@ static int __init falconide_init(void) | |||
111 | u8 index = hwif->index; | 111 | u8 index = hwif->index; |
112 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; | 112 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; |
113 | 113 | ||
114 | ide_init_port_data(hwif, index); | ||
115 | ide_init_port_hw(hwif, &hw); | 114 | ide_init_port_hw(hwif, &hw); |
116 | 115 | ||
117 | /* Atari has a byte-swapped IDE interface */ | 116 | /* Atari has a byte-swapped IDE interface */ |
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index b78941680c32..7e74b20202df 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c | |||
@@ -185,7 +185,6 @@ found: | |||
185 | if (hwif) { | 185 | if (hwif) { |
186 | u8 index = hwif->index; | 186 | u8 index = hwif->index; |
187 | 187 | ||
188 | ide_init_port_data(hwif, index); | ||
189 | ide_init_port_hw(hwif, &hw); | 188 | ide_init_port_hw(hwif, &hw); |
190 | 189 | ||
191 | idx[i] = index; | 190 | idx[i] = index; |
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 8dbf4d9b6447..7c69608154c2 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
@@ -187,7 +187,6 @@ static ide_hwif_t *idecs_register(unsigned long io, unsigned long ctl, | |||
187 | 187 | ||
188 | i = hwif->index; | 188 | i = hwif->index; |
189 | 189 | ||
190 | ide_init_port_data(hwif, i); | ||
191 | ide_init_port_hw(hwif, &hw); | 190 | ide_init_port_hw(hwif, &hw); |
192 | hwif->port_ops = &idecs_port_ops; | 191 | hwif->port_ops = &idecs_port_ops; |
193 | 192 | ||
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index 2e84290d0bcc..0a6195bcfeda 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c | |||
@@ -130,7 +130,6 @@ static int __init macide_init(void) | |||
130 | u8 index = hwif->index; | 130 | u8 index = hwif->index; |
131 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; | 131 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; |
132 | 132 | ||
133 | ide_init_port_data(hwif, index); | ||
134 | ide_init_port_hw(hwif, &hw); | 133 | ide_init_port_hw(hwif, &hw); |
135 | 134 | ||
136 | ide_device_add(idx, NULL); | 135 | ide_device_add(idx, NULL); |
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c index 8ff6e2d20834..9c2b9d078f69 100644 --- a/drivers/ide/legacy/q40ide.c +++ b/drivers/ide/legacy/q40ide.c | |||
@@ -142,7 +142,6 @@ static int __init q40ide_init(void) | |||
142 | 142 | ||
143 | hwif = ide_find_port(); | 143 | hwif = ide_find_port(); |
144 | if (hwif) { | 144 | if (hwif) { |
145 | ide_init_port_data(hwif, hwif->index); | ||
146 | ide_init_port_hw(hwif, &hw); | 145 | ide_init_port_hw(hwif, &hw); |
147 | 146 | ||
148 | /* Q40 has a byte-swapped IDE interface */ | 147 | /* Q40 has a byte-swapped IDE interface */ |
diff --git a/drivers/ide/pci/delkin_cb.c b/drivers/ide/pci/delkin_cb.c index af0f30051d5a..0106e2a2df77 100644 --- a/drivers/ide/pci/delkin_cb.c +++ b/drivers/ide/pci/delkin_cb.c | |||
@@ -93,7 +93,6 @@ delkin_cb_probe (struct pci_dev *dev, const struct pci_device_id *id) | |||
93 | 93 | ||
94 | i = hwif->index; | 94 | i = hwif->index; |
95 | 95 | ||
96 | ide_init_port_data(hwif, i); | ||
97 | ide_init_port_hw(hwif, &hw); | 96 | ide_init_port_hw(hwif, &hw); |
98 | 97 | ||
99 | idx[0] = i; | 98 | idx[0] = i; |