aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sc1200.c
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/pci/sc1200.c
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/pci/sc1200.c')
-rw-r--r--drivers/ide/pci/sc1200.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 50405ed6f0cb..79eeeadad655 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -126,7 +126,6 @@ static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode)
126{ 126{
127 ide_hwif_t *hwif = HWIF(drive); 127 ide_hwif_t *hwif = HWIF(drive);
128 struct pci_dev *dev = to_pci_dev(hwif->dev); 128 struct pci_dev *dev = to_pci_dev(hwif->dev);
129 int unit = drive->select.b.unit;
130 unsigned int reg, timings; 129 unsigned int reg, timings;
131 unsigned short pci_clock; 130 unsigned short pci_clock;
132 unsigned int basereg = hwif->channel ? 0x50 : 0x40; 131 unsigned int basereg = hwif->channel ? 0x50 : 0x40;
@@ -155,7 +154,7 @@ static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode)
155 else 154 else
156 timings = mwdma_timing[pci_clock][mode - XFER_MW_DMA_0]; 155 timings = mwdma_timing[pci_clock][mode - XFER_MW_DMA_0];
157 156
158 if (unit == 0) { /* are we configuring drive0? */ 157 if ((drive->dn & 1) == 0) {
159 pci_read_config_dword(dev, basereg + 4, &reg); 158 pci_read_config_dword(dev, basereg + 4, &reg);
160 timings |= reg & 0x80000000; /* preserve PIO format bit */ 159 timings |= reg & 0x80000000; /* preserve PIO format bit */
161 pci_write_config_dword(dev, basereg + 4, timings); 160 pci_write_config_dword(dev, basereg + 4, timings);