/* Turn a config register offset into the right address in either PCI space or MMIO space to access the control register in question including accounting for the unit shift.  */
static unsigned long siimage_seldev(ide_drive_t *drive, int r)
/* Turn a config register offset into the right address in either PCI space or MMIO space to access the control register in question including accounting for the unit shift.  */
static unsigned long siimage_seldev(ide_drive_t *drive, int r)
{
	ide_hwif_t *hwif	= drive->hwif;
	unsigned long base	= (unsigned long)hwif->hwif_data;
	u8 unit			= drive->dn & 1;
	base += 0xA0 + r;
	if (hwif->host_flags & IDE_HFLAG_MMIO)
		base += hwif->channel << 6;
	else
		base += hwif->channel << 4;
	base |= unit << unit;
	return base;
}