aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.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/ide.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/ide.c')
-rw-r--r--drivers/ide/ide.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 40b5a4614340..7624b937398a 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -713,9 +713,9 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
713module_param_call(chs, ide_set_disk_chs, NULL, NULL, 0); 713module_param_call(chs, ide_set_disk_chs, NULL, NULL, 0);
714MODULE_PARM_DESC(chs, "force device as a disk (using CHS)"); 714MODULE_PARM_DESC(chs, "force device as a disk (using CHS)");
715 715
716static void ide_dev_apply_params(ide_drive_t *drive) 716static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
717{ 717{
718 int i = drive->hwif->index * MAX_DRIVES + drive->select.b.unit; 718 int i = drive->hwif->index * MAX_DRIVES + unit;
719 719
720 if (ide_nodma & (1 << i)) { 720 if (ide_nodma & (1 << i)) {
721 printk(KERN_INFO "ide: disallowing DMA for %s\n", drive->name); 721 printk(KERN_INFO "ide: disallowing DMA for %s\n", drive->name);
@@ -791,7 +791,7 @@ void ide_port_apply_params(ide_hwif_t *hwif)
791 } 791 }
792 792
793 for (i = 0; i < MAX_DRIVES; i++) 793 for (i = 0; i < MAX_DRIVES; i++)
794 ide_dev_apply_params(&hwif->drives[i]); 794 ide_dev_apply_params(&hwif->drives[i], i);
795} 795}
796 796
797/* 797/*