aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:31 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:31 -0400
commit8447d9d52adbe4c653482bd0d5ccb9b5d26f9c9d (patch)
tree358aa3ca6b0657623b84e7c6278f90fc95a32879 /drivers/ide/legacy
parentfd9bb53942a7ca3398a63f2c238afd8fbed3ec0e (diff)
ide: add ide_device_add()
* Add ide_device_add() helper and convert host drivers to use it instead of open-coded variants. * Make ide_pci_setup_ports() and do_ide_setup_pci_device() take 'u8 *idx' argument instead of 'ata_index_t *index'. * Remove no longer needed ata_index_t. * Unexport probe_hwif_init() and make it static. * Unexport ide_proc_register_port(). There should be no functionality changes caused by this patch (sgiioc4.c: ide_proc_register_port() requires hwif->present to be set and it won't be set if probe_hwif_init() fails). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy')
-rw-r--r--drivers/ide/legacy/ali14xx.c7
-rw-r--r--drivers/ide/legacy/dtc2278.c7
-rw-r--r--drivers/ide/legacy/ht6560b.c7
-rw-r--r--drivers/ide/legacy/ide_platform.c6
-rw-r--r--drivers/ide/legacy/qd65xx.c21
-rw-r--r--drivers/ide/legacy/umc8672.c9
6 files changed, 23 insertions, 34 deletions
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index 2f0ef9b44033..0973c85e49b7 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -193,6 +193,7 @@ static int __init initRegisters (void) {
193static int __init ali14xx_probe(void) 193static int __init ali14xx_probe(void)
194{ 194{
195 ide_hwif_t *hwif, *mate; 195 ide_hwif_t *hwif, *mate;
196 static u8 idx[4] = { 0, 1, 0xff, 0xff };
196 197
197 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n", 198 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
198 basePort, regOn); 199 basePort, regOn);
@@ -217,11 +218,7 @@ static int __init ali14xx_probe(void)
217 mate->mate = hwif; 218 mate->mate = hwif;
218 mate->channel = 1; 219 mate->channel = 1;
219 220
220 probe_hwif_init(hwif); 221 ide_device_add(idx);
221 probe_hwif_init(mate);
222
223 ide_proc_register_port(hwif);
224 ide_proc_register_port(mate);
225 222
226 return 0; 223 return 0;
227} 224}
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index f16521254867..12a7182b4ad3 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -94,6 +94,7 @@ static int __init dtc2278_probe(void)
94{ 94{
95 unsigned long flags; 95 unsigned long flags;
96 ide_hwif_t *hwif, *mate; 96 ide_hwif_t *hwif, *mate;
97 static u8 idx[4] = { 0, 1, 0xff, 0xff };
97 98
98 hwif = &ide_hwifs[0]; 99 hwif = &ide_hwifs[0];
99 mate = &ide_hwifs[1]; 100 mate = &ide_hwifs[1];
@@ -134,11 +135,7 @@ static int __init dtc2278_probe(void)
134 mate->mate = hwif; 135 mate->mate = hwif;
135 mate->channel = 1; 136 mate->channel = 1;
136 137
137 probe_hwif_init(hwif); 138 ide_device_add(idx);
138 probe_hwif_init(mate);
139
140 ide_proc_register_port(hwif);
141 ide_proc_register_port(mate);
142 139
143 return 0; 140 return 0;
144} 141}
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 2e5a9cc5c0f7..7f0d433cb9d8 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -311,6 +311,7 @@ MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
311int __init ht6560b_init(void) 311int __init ht6560b_init(void)
312{ 312{
313 ide_hwif_t *hwif, *mate; 313 ide_hwif_t *hwif, *mate;
314 static u8 idx[4] = { 0, 1, 0xff, 0xff };
314 int t; 315 int t;
315 316
316 if (probe_ht6560b == 0) 317 if (probe_ht6560b == 0)
@@ -359,11 +360,7 @@ int __init ht6560b_init(void)
359 mate->drives[0].drive_data = t; 360 mate->drives[0].drive_data = t;
360 mate->drives[1].drive_data = t; 361 mate->drives[1].drive_data = t;
361 362
362 probe_hwif_init(hwif); 363 ide_device_add(idx);
363 probe_hwif_init(mate);
364
365 ide_proc_register_port(hwif);
366 ide_proc_register_port(mate);
367 364
368 return 0; 365 return 0;
369 366
diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c
index b992b2b91fe2..9a153915f3cf 100644
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -83,6 +83,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
83 struct resource *res_base, *res_alt, *res_irq; 83 struct resource *res_base, *res_alt, *res_irq;
84 ide_hwif_t *hwif; 84 ide_hwif_t *hwif;
85 struct pata_platform_info *pdata; 85 struct pata_platform_info *pdata;
86 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
86 int ret = 0; 87 int ret = 0;
87 int mmio = 0; 88 int mmio = 0;
88 89
@@ -130,10 +131,11 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
130 hwif->gendev.parent = &pdev->dev; 131 hwif->gendev.parent = &pdev->dev;
131 hwif->noprobe = 0; 132 hwif->noprobe = 0;
132 133
133 probe_hwif_init(hwif); 134 idx[0] = hwif->index;
135
136 ide_device_add(idx);
134 137
135 platform_set_drvdata(pdev, hwif); 138 platform_set_drvdata(pdev, hwif);
136 ide_proc_register_port(hwif);
137 139
138 return 0; 140 return 0;
139 141
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 0c81d2d0b941..85104bc79a1d 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -389,6 +389,7 @@ static void __exit qd_unsetup(ide_hwif_t *hwif)
389static int __init qd_probe(int base) 389static int __init qd_probe(int base)
390{ 390{
391 ide_hwif_t *hwif; 391 ide_hwif_t *hwif;
392 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
392 u8 config; 393 u8 config;
393 u8 unit; 394 u8 unit;
394 395
@@ -419,9 +420,9 @@ static int __init qd_probe(int base)
419 420
420 hwif->set_pio_mode = &qd6500_set_pio_mode; 421 hwif->set_pio_mode = &qd6500_set_pio_mode;
421 422
422 probe_hwif_init(hwif); 423 idx[0] = unit;
423 424
424 ide_proc_register_port(hwif); 425 ide_device_add(idx);
425 426
426 return 1; 427 return 1;
427 } 428 }
@@ -453,11 +454,11 @@ static int __init qd_probe(int base)
453 454
454 hwif->set_pio_mode = &qd6580_set_pio_mode; 455 hwif->set_pio_mode = &qd6580_set_pio_mode;
455 456
456 probe_hwif_init(hwif); 457 idx[0] = unit;
457 458
458 qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); 459 ide_device_add(idx);
459 460
460 ide_proc_register_port(hwif); 461 qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);
461 462
462 return 1; 463 return 1;
463 } else { 464 } else {
@@ -474,19 +475,17 @@ static int __init qd_probe(int base)
474 475
475 hwif->set_pio_mode = &qd6580_set_pio_mode; 476 hwif->set_pio_mode = &qd6580_set_pio_mode;
476 477
477 probe_hwif_init(hwif);
478
479 qd_setup(mate, base, config | (control << 8), 478 qd_setup(mate, base, config | (control << 8),
480 QD6580_DEF_DATA2, QD6580_DEF_DATA2); 479 QD6580_DEF_DATA2, QD6580_DEF_DATA2);
481 480
482 mate->set_pio_mode = &qd6580_set_pio_mode; 481 mate->set_pio_mode = &qd6580_set_pio_mode;
483 482
484 probe_hwif_init(mate); 483 idx[0] = 0;
484 idx[1] = 1;
485 485
486 qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); 486 ide_device_add(idx);
487 487
488 ide_proc_register_port(hwif); 488 qd_write_reg(QD_DEF_CONTR, QD_CONTROL_PORT);
489 ide_proc_register_port(mate);
490 489
491 return 0; /* no other qd65xx possible */ 490 return 0; /* no other qd65xx possible */
492 } 491 }
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c
index 1151c92dd531..79577b916874 100644
--- a/drivers/ide/legacy/umc8672.c
+++ b/drivers/ide/legacy/umc8672.c
@@ -124,8 +124,9 @@ static void umc_set_pio_mode(ide_drive_t *drive, const u8 pio)
124 124
125static int __init umc8672_probe(void) 125static int __init umc8672_probe(void)
126{ 126{
127 unsigned long flags;
128 ide_hwif_t *hwif, *mate; 127 ide_hwif_t *hwif, *mate;
128 unsigned long flags;
129 static u8 idx[4] = { 0, 1, 0xff, 0xff };
129 130
130 if (!request_region(0x108, 2, "umc8672")) { 131 if (!request_region(0x108, 2, "umc8672")) {
131 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n"); 132 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n");
@@ -158,11 +159,7 @@ static int __init umc8672_probe(void)
158 mate->mate = hwif; 159 mate->mate = hwif;
159 mate->channel = 1; 160 mate->channel = 1;
160 161
161 probe_hwif_init(hwif); 162 ide_device_add(idx);
162 probe_hwif_init(mate);
163
164 ide_proc_register_port(hwif);
165 ide_proc_register_port(mate);
166 163
167 return 0; 164 return 0;
168} 165}