Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93637
b: refs/heads/master
c: d9b819a
h: refs/heads/master
i:
  93635: daa1f05
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent 3f3c004 commit f38cd56
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2305d94321bbbdc461acfb24b41fbf50f8a6dd91
refs/heads/master: d9b819a025ca1b09dafbe90b5d25ba57a639f048
56 changes: 33 additions & 23 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,40 +1630,50 @@ void ide_port_scan(ide_hwif_t *hwif)
}
EXPORT_SYMBOL_GPL(ide_port_scan);

int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no,
const struct ide_port_info *d,
unsigned long config)
{
ide_hwif_t *hwif, *mate;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw[2];

memset(&hw, 0, sizeof(hw));
ide_hwif_t *hwif;
unsigned long base, ctl;
int irq;

ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
hw[0].irq = 14;
if (port_no == 0) {
base = 0x1f0;
ctl = 0x3f6;
irq = 14;
} else {
base = 0x170;
ctl = 0x376;
irq = 15;
}

ide_std_init_ports(&hw[1], 0x170, 0x376);
hw[1].irq = 15;
ide_std_init_ports(hw, base, ctl);
hw->irq = irq;

hwif = ide_find_port_slot(d);
if (hwif) {
u8 j = (d->host_flags & IDE_HFLAG_QD_2ND_PORT) ? 1 : 0;

ide_init_port_hw(hwif, &hw[j]);
ide_init_port_hw(hwif, hw);
if (config)
hwif->config_data = config;
idx[j] = hwif->index;
idx[port_no] = hwif->index;
}
}

if (hwif == NULL && (d->host_flags & IDE_HFLAG_SINGLE))
return -ENOENT;
int ide_legacy_device_add(const struct ide_port_info *d, unsigned long config)
{
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw[2];

mate = ide_find_port_slot(d);
if (mate) {
ide_init_port_hw(mate, &hw[1]);
if (config)
mate->config_data = config;
idx[1] = mate->index;
}
memset(&hw, 0, sizeof(hw));

if ((d->host_flags & IDE_HFLAG_QD_2ND_PORT) == 0)
ide_legacy_init_one(idx, &hw[0], 0, d, config);
ide_legacy_init_one(idx, &hw[1], 1, d, config);

if (idx[0] == 0xff && idx[1] == 0xff &&
(d->host_flags & IDE_HFLAG_SINGLE))
return -ENOENT;

ide_device_add(idx, d);

Expand Down

0 comments on commit f38cd56

Please sign in to comment.