aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/siimage.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/siimage.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/siimage.c')
-rw-r--r--drivers/ide/pci/siimage.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 174a873b4c64..134868c71c34 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -116,13 +116,14 @@ static inline unsigned long siimage_seldev(ide_drive_t *drive, int r)
116{ 116{
117 ide_hwif_t *hwif = HWIF(drive); 117 ide_hwif_t *hwif = HWIF(drive);
118 unsigned long base = (unsigned long)hwif->hwif_data; 118 unsigned long base = (unsigned long)hwif->hwif_data;
119 u8 unit = drive->dn & 1;
119 120
120 base += 0xA0 + r; 121 base += 0xA0 + r;
121 if (hwif->host_flags & IDE_HFLAG_MMIO) 122 if (hwif->host_flags & IDE_HFLAG_MMIO)
122 base += hwif->channel << 6; 123 base += hwif->channel << 6;
123 else 124 else
124 base += hwif->channel << 4; 125 base += hwif->channel << 4;
125 base |= drive->select.b.unit << drive->select.b.unit; 126 base |= unit << unit;
126 return base; 127 return base;
127} 128}
128 129
@@ -255,7 +256,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
255 u8 addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84) 256 u8 addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
256 : (mmio ? 0xB4 : 0x80); 257 : (mmio ? 0xB4 : 0x80);
257 u8 mode = 0; 258 u8 mode = 0;
258 u8 unit = drive->select.b.unit; 259 u8 unit = drive->dn & 1;
259 260
260 /* trim *taskfile* PIO to the slowest of the master/slave */ 261 /* trim *taskfile* PIO to the slowest of the master/slave */
261 if (pair) { 262 if (pair) {
@@ -301,9 +302,9 @@ static void sil_set_dma_mode(ide_drive_t *drive, const u8 speed)
301 302
302 ide_hwif_t *hwif = HWIF(drive); 303 ide_hwif_t *hwif = HWIF(drive);
303 struct pci_dev *dev = to_pci_dev(hwif->dev); 304 struct pci_dev *dev = to_pci_dev(hwif->dev);
304 u16 ultra = 0, multi = 0;
305 u8 mode = 0, unit = drive->select.b.unit;
306 unsigned long base = (unsigned long)hwif->hwif_data; 305 unsigned long base = (unsigned long)hwif->hwif_data;
306 u16 ultra = 0, multi = 0;
307 u8 mode = 0, unit = drive->dn & 1;
307 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; 308 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
308 u8 scsc = 0, addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84) 309 u8 scsc = 0, addr_mask = hwif->channel ? (mmio ? 0xF4 : 0x84)
309 : (mmio ? 0xB4 : 0x80); 310 : (mmio ? 0xB4 : 0x80);