hwif->gendev.parent = hw->dev;
int ide_register_hw_with_fixup(hw_regs_t *hw, ide_hwif_t **hwifp, void(*fixup)(ide_hwif_t *hwif)){	int index, retry = 1;	ide_hwif_t *hwif;	do {		for (index = 0; index < MAX_HWIFS; ++index) {			hwif = &ide_hwifs[index];			if (hwif->hw.io_ports[IDE_DATA_OFFSET] == hw->io_ports[IDE_DATA_OFFSET])				goto found;		}		for (index = 0; index < MAX_HWIFS; ++index) {			hwif = &ide_hwifs[index];			if (hwif->hold)				continue;			if ((!hwif->present && !hwif->mate && !initializing) ||			    (!hwif->hw.io_ports[IDE_DATA_OFFSET] && initializing))				goto found;		}		for (index = 0; index < MAX_HWIFS; index++)			ide_unregister(index);	} while (retry--);	return -1;found:	if (hwif->present)		ide_unregister(index);	else if (!hwif->hold) {		init_hwif_data(hwif, index);		init_hwif_default(hwif, index);	}	if (hwif->present)		return -1;	memcpy(&hwif->hw, hw, sizeof(*hw));	memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));	hwif->irq = hw->irq;	hwif->noprobe = 0;	hwif->chipset = hw->chipset;	if (!initializing) {		probe_hwif_init_with_fixup(hwif, fixup);		create_proc_ide_interfaces();	}	if (hwifp)		*hwifp = hwif;	return (initializing || hwif->present) ? index : -1;}