/* Turn a config register offset into the right address in either PCI space or MMIO space to access the control register in question Thankfully this is a configuration operation, so isn't performance critical.  */
static unsigned long siimage_selreg(ide_hwif_t *hwif, 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 Thankfully this is a configuration operation, so isn't performance critical.  */
static unsigned long siimage_selreg(ide_hwif_t *hwif, int r)
{
	unsigned long base = (unsigned long)hwif->hwif_data;
	base += 0xA0 + r;
	if (hwif->host_flags & IDE_HFLAG_MMIO)
		base += hwif->channel << 6;
	else
		base += hwif->channel << 4;
	return base;
}