From 123995b97136cb41fa282f0ed2385f2c8066df96 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Mon, 13 Oct 2008 21:39:40 +0200 Subject: 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 --- drivers/ide/ide.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/ide/ide.c') diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 40b5a461434..7624b937398 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) module_param_call(chs, ide_set_disk_chs, NULL, NULL, 0); MODULE_PARM_DESC(chs, "force device as a disk (using CHS)"); -static void ide_dev_apply_params(ide_drive_t *drive) +static void ide_dev_apply_params(ide_drive_t *drive, u8 unit) { - int i = drive->hwif->index * MAX_DRIVES + drive->select.b.unit; + int i = drive->hwif->index * MAX_DRIVES + unit; if (ide_nodma & (1 << i)) { printk(KERN_INFO "ide: disallowing DMA for %s\n", drive->name); @@ -791,7 +791,7 @@ void ide_port_apply_params(ide_hwif_t *hwif) } for (i = 0; i < MAX_DRIVES; i++) - ide_dev_apply_params(&hwif->drives[i]); + ide_dev_apply_params(&hwif->drives[i], i); } /* -- cgit v1.2.3