aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/cy82c693.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/cy82c693.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/cy82c693.c')
-rw-r--r--drivers/ide/pci/cy82c693.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index 5241ef74f8d9..e5f8fc0ed318 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -178,8 +178,7 @@ static void cy82c693_set_dma_mode(ide_drive_t *drive, const u8 mode)
178 178
179#if CY82C693_DEBUG_INFO 179#if CY82C693_DEBUG_INFO
180 printk(KERN_INFO "%s (ch=%d, dev=%d): set DMA mode to %d (single=%d)\n", 180 printk(KERN_INFO "%s (ch=%d, dev=%d): set DMA mode to %d (single=%d)\n",
181 drive->name, HWIF(drive)->channel, drive->select.b.unit, 181 drive->name, hwif->channel, drive->dn & 1, mode & 3, single);
182 mode & 3, single);
183#endif /* CY82C693_DEBUG_INFO */ 182#endif /* CY82C693_DEBUG_INFO */
184 183
185 /* 184 /*
@@ -224,7 +223,7 @@ static void cy82c693_set_pio_mode(ide_drive_t *drive, const u8 pio)
224 compute_clocks(pio, &pclk); 223 compute_clocks(pio, &pclk);
225 224
226 /* now let's write the clocks registers */ 225 /* now let's write the clocks registers */
227 if (drive->select.b.unit == 0) { 226 if ((drive->dn & 1) == 0) {
228 /* 227 /*
229 * set master drive 228 * set master drive
230 * address setup control register 229 * address setup control register
@@ -266,7 +265,7 @@ static void cy82c693_set_pio_mode(ide_drive_t *drive, const u8 pio)
266#if CY82C693_DEBUG_INFO 265#if CY82C693_DEBUG_INFO
267 printk(KERN_INFO "%s (ch=%d, dev=%d): set PIO timing to " 266 printk(KERN_INFO "%s (ch=%d, dev=%d): set PIO timing to "
268 "(addr=0x%X, ior=0x%X, iow=0x%X, 8bit=0x%X)\n", 267 "(addr=0x%X, ior=0x%X, iow=0x%X, 8bit=0x%X)\n",
269 drive->name, hwif->channel, drive->select.b.unit, 268 drive->name, hwif->channel, drive->dn & 1,
270 addrCtrl, pclk.time_16r, pclk.time_16w, pclk.time_8); 269 addrCtrl, pclk.time_16r, pclk.time_16w, pclk.time_8);
271#endif /* CY82C693_DEBUG_INFO */ 270#endif /* CY82C693_DEBUG_INFO */
272} 271}