diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:40 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:40 -0400 |
commit | 123995b97136cb41fa282f0ed2385f2c8066df96 (patch) | |
tree | 39b994f29bac4dc931be9abdde1e7f5412692856 /drivers/ide/pci/cmd640.c | |
parent | 8595259ccb6a13b9aab31832ce874d157064d256 (diff) |
ide: use 'drive->dn & 1' instead of drive->select.b.unit
* Call ide_port_init_devices() in ide_host_register()
also if 'struct ide_port_info *d' is not available.
* Init drive->dn in ide_port_init_devices() instead of
ide_probe_port() so it is valid also in ->init_dev.
* Pass device number to ide_dev_apply_params().
* Use 'drive->dn & 1' instead of drive->select.b.unit.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/cmd640.c')
-rw-r--r-- | drivers/ide/pci/cmd640.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index d3afdffcb07a..e4306647d00d 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
@@ -468,7 +468,7 @@ static void program_drive_counts(ide_drive_t *drive, unsigned int index) | |||
468 | */ | 468 | */ |
469 | if (index > 1) { | 469 | if (index > 1) { |
470 | ide_hwif_t *hwif = drive->hwif; | 470 | ide_hwif_t *hwif = drive->hwif; |
471 | ide_drive_t *peer = &hwif->drives[!drive->select.b.unit]; | 471 | ide_drive_t *peer = &hwif->drives[!(drive->dn & 1)]; |
472 | unsigned int mate = index ^ 1; | 472 | unsigned int mate = index ^ 1; |
473 | 473 | ||
474 | if (peer->dev_flags & IDE_DFLAG_PRESENT) { | 474 | if (peer->dev_flags & IDE_DFLAG_PRESENT) { |
@@ -607,7 +607,7 @@ static void cmd640_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
607 | 607 | ||
608 | static void cmd640_init_dev(ide_drive_t *drive) | 608 | static void cmd640_init_dev(ide_drive_t *drive) |
609 | { | 609 | { |
610 | unsigned int i = drive->hwif->channel * 2 + drive->select.b.unit; | 610 | unsigned int i = drive->hwif->channel * 2 + (drive->dn & 1); |
611 | 611 | ||
612 | #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED | 612 | #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED |
613 | /* | 613 | /* |