aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy')
-rw-r--r--drivers/ide/legacy/buddha.c11
-rw-r--r--drivers/ide/legacy/falconide.c14
-rw-r--r--drivers/ide/legacy/gayle.c10
-rw-r--r--drivers/ide/legacy/ide-cs.c2
-rw-r--r--drivers/ide/legacy/macide.c29
-rw-r--r--drivers/ide/legacy/q40ide.c10
6 files changed, 45 insertions, 31 deletions
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index 4a0be251a05..8b9cb39c961 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -147,7 +147,7 @@ void __init buddha_init(void)
{
hw_regs_t hw;
ide_hwif_t *hwif;
- int i, index;
+ int i;
struct zorro_dev *z = NULL;
u_long buddha_board = 0;
@@ -213,8 +213,13 @@ fail_base2:
IRQ_AMIGA_PORTS);
}
- index = ide_register_hw(&hw, NULL, 1, &hwif);
- if (index != -1) {
+ hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+ if (hwif) {
+ u8 index = hwif->index;
+
+ ide_init_port_data(hwif, index);
+ ide_init_port_hw(hwif, &hw);
+
hwif->mmio = 1;
printk("ide%d: ", index);
switch(type) {
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index 7d7936f1b90..b861cfe2590 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -66,15 +66,19 @@ void __init falconide_init(void)
{
if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
hw_regs_t hw;
- int index;
ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets,
0, 0, NULL,
// falconide_iops,
IRQ_MFP_IDE);
- index = ide_register_hw(&hw, NULL, 1, NULL);
- if (index != -1)
- printk("ide%d: Falcon IDE interface\n", index);
- }
+ hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+ if (hwif) {
+ u8 index = hwif->index;
+
+ ide_init_port_data(hwif, index);
+ ide_init_port_hw(hwif, &hw);
+
+ printk("ide%d: Falcon IDE interface\n", index);
+ }
}
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 53331ee1e95..705d0b8a3f5 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -133,7 +133,6 @@ found:
ide_ack_intr_t *ack_intr;
hw_regs_t hw;
ide_hwif_t *hwif;
- int index;
unsigned long phys_base, res_start, res_n;
if (a4000) {
@@ -165,8 +164,13 @@ found:
// &gayle_iops,
IRQ_AMIGA_PORTS);
- index = ide_register_hw(&hw, NULL, 1, &hwif);
- if (index != -1) {
+ hwif = ide_find_port(base);
+ if (hwif) {
+ u8 index = hwif->index;
+
+ ide_init_port_data(hwif, index);
+ ide_init_port_hw(hwif, &hw);
+
hwif->mmio = 1;
switch (i) {
case 0:
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 03715c05866..f4ea15b3296 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -153,7 +153,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
hw.irq = irq;
hw.chipset = ide_pci;
hw.dev = &handle->dev;
- return ide_register_hw(&hw, &ide_undecoded_slave, 0, NULL);
+ return ide_register_hw(&hw, &ide_undecoded_slave, NULL);
}
/*======================================================================
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index 5c6aa77c237..1840fede521 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -85,7 +85,6 @@ void __init macide_init(void)
{
hw_regs_t hw;
ide_hwif_t *hwif;
- int index = -1;
switch (macintosh_config->ide_type) {
case MAC_IDE_QUADRA:
@@ -93,40 +92,40 @@ void __init macide_init(void)
0, 0, macide_ack_intr,
// quadra_ide_iops,
IRQ_NUBUS_F);
- index = ide_register_hw(&hw, NULL, 1, &hwif);
break;
case MAC_IDE_PB:
ide_setup_ports(&hw, IDE_BASE, macide_offsets,
0, 0, macide_ack_intr,
// macide_pb_iops,
IRQ_NUBUS_C);
- index = ide_register_hw(&hw, NULL, 1, &hwif);
break;
case MAC_IDE_BABOON:
ide_setup_ports(&hw, BABOON_BASE, macide_offsets,
0, 0, NULL,
// macide_baboon_iops,
IRQ_BABOON_1);
- index = ide_register_hw(&hw, NULL, 1, &hwif);
- if (index == -1) break;
- if (macintosh_config->ident == MAC_MODEL_PB190) {
+ break;
+ default:
+ return;
+ }
+ hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+ if (hwif) {
+ u8 index = hwif->index;
+
+ ide_init_port_data(hwif, index);
+ ide_init_port_hw(hwif, &hw);
+
+ if (macintosh_config->ide_type == MAC_IDE_BABOON &&
+ macintosh_config->ident == MAC_MODEL_PB190) {
/* Fix breakage in ide-disk.c: drive capacity */
/* is not initialized for drives without a */
/* hardware ID, and we can't get that without */
/* probing the drive which freezes a 190. */
-
- ide_drive_t *drive = &ide_hwifs[index].drives[0];
+ ide_drive_t *drive = &hwif->drives[0];
drive->capacity64 = drive->cyl*drive->head*drive->sect;
-
}
- break;
-
- default:
- return;
- }
- if (index != -1) {
hwif->mmio = 1;
if (macintosh_config->ide_type == MAC_IDE_QUADRA)
printk(KERN_INFO "ide%d: Macintosh Quadra IDE interface\n", index);
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 6ea46a6723e..31e54ffdfee 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -115,7 +115,6 @@ void __init q40ide_init(void)
{
int i;
ide_hwif_t *hwif;
- int index;
const char *name;
if (!MACH_IS_Q40)
@@ -141,10 +140,13 @@ void __init q40ide_init(void)
0, NULL,
// m68kide_iops,
q40ide_default_irq(pcide_bases[i]));
- index = ide_register_hw(&hw, NULL, 1, &hwif);
- // **FIXME**
- if (index != -1)
+
+ hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+ if (hwif) {
+ ide_init_port_data(hwif, hwif->index);
+ ide_init_port_hw(hwif, &hw);
hwif->mmio = 1;
+ }
}
}