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>
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index 7276c96..90da1f9 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -131,7 +131,7 @@
 		drive->name, pio, time1, time2, param1, param2, param3, param4);
 
 	/* stuff timing parameters into controller registers */
-	driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit;
+	driveNum = (drive->hwif->index << 1) + (drive->dn & 1);
 	spin_lock_irqsave(&ali14xx_lock, flags);
 	outb_p(regOn, basePort);
 	outReg(param1, regTab[driveNum].reg1);