aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ppc
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:40 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:40 -0400
commit123995b97136cb41fa282f0ed2385f2c8066df96 (patch)
tree39b994f29bac4dc931be9abdde1e7f5412692856 /drivers/ide/ppc
parent8595259ccb6a13b9aab31832ce874d157064d256 (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/ppc')
-rw-r--r--drivers/ide/ppc/pmac.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 2de22b6fe3bd..5b083700d882 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -433,7 +433,7 @@ pmac_ide_selectproc(ide_drive_t *drive)
433 if (pmif == NULL) 433 if (pmif == NULL)
434 return; 434 return;
435 435
436 if (drive->select.b.unit & 0x01) 436 if (drive->dn & 1)
437 writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG)); 437 writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG));
438 else 438 else
439 writel(pmif->timings[0], PMAC_IDE_REG(IDE_TIMING_CONFIG)); 439 writel(pmif->timings[0], PMAC_IDE_REG(IDE_TIMING_CONFIG));
@@ -455,7 +455,7 @@ pmac_ide_kauai_selectproc(ide_drive_t *drive)
455 if (pmif == NULL) 455 if (pmif == NULL)
456 return; 456 return;
457 457
458 if (drive->select.b.unit & 0x01) { 458 if (drive->dn & 1) {
459 writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); 459 writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG));
460 writel(pmif->timings[3], PMAC_IDE_REG(IDE_KAUAI_ULTRA_CONFIG)); 460 writel(pmif->timings[3], PMAC_IDE_REG(IDE_KAUAI_ULTRA_CONFIG));
461 } else { 461 } else {
@@ -528,7 +528,7 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
528 return; 528 return;
529 529
530 /* which drive is it ? */ 530 /* which drive is it ? */
531 timings = &pmif->timings[drive->select.b.unit & 0x01]; 531 timings = &pmif->timings[drive->dn & 1];
532 t = *timings; 532 t = *timings;
533 533
534 cycle_time = ide_pio_cycle_time(drive, pio); 534 cycle_time = ide_pio_cycle_time(drive, pio);
@@ -805,9 +805,9 @@ static void pmac_ide_set_dma_mode(ide_drive_t *drive, const u8 speed)
805 ide_hwif_t *hwif = drive->hwif; 805 ide_hwif_t *hwif = drive->hwif;
806 pmac_ide_hwif_t *pmif = 806 pmac_ide_hwif_t *pmif =
807 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); 807 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
808 int unit = (drive->select.b.unit & 0x01);
809 int ret = 0; 808 int ret = 0;
810 u32 *timings, *timings2, tl[2]; 809 u32 *timings, *timings2, tl[2];
810 u8 unit = drive->dn & 1;
811 811
812 timings = &pmif->timings[unit]; 812 timings = &pmif->timings[unit];
813 timings2 = &pmif->timings[unit+2]; 813 timings2 = &pmif->timings[unit+2];
@@ -1558,8 +1558,7 @@ pmac_ide_dma_setup(ide_drive_t *drive)
1558 pmac_ide_hwif_t *pmif = 1558 pmac_ide_hwif_t *pmif =
1559 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); 1559 (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
1560 struct request *rq = HWGROUP(drive)->rq; 1560 struct request *rq = HWGROUP(drive)->rq;
1561 u8 unit = (drive->select.b.unit & 0x01); 1561 u8 unit = drive->dn & 1, ata4;
1562 u8 ata4;
1563 1562
1564 if (pmif == NULL) 1563 if (pmif == NULL)
1565 return 1; 1564 return 1;