ide: add ->fixup method to ide_hwif_t

* Add ->fixup method to ide_hwif_t.

* Set hwif->fixup in ide_pci_setup_ports() to d->fixup.

* Use hwif->fixup in probe_hwif().

* Use probe_hwif_init() instead of probe_hwif_init_with_fixup() in
  ide_setup_pci_device().

* Add 'fixup' argument to ide_register_hw() and use it to set hwif->fixup,
  update all ide_register_hw() users accordingly.

* Convert ide-cs/delkin_cb host drivers to use ide_register_hw().

* Restore hwif->fixup in ide_hwif_restore().

* Remove ide_register_hw_with_fixup(), probe_hwif_init_with_fixup()
  and 'fixup' argument from probe_hwif().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 961e6c8..35f24b9 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -391,6 +391,8 @@
 	hwif->cds			= tmp_hwif->cds;
 #endif
 
+	hwif->fixup			= tmp_hwif->fixup;
+
 	hwif->set_pio_mode		= tmp_hwif->set_pio_mode;
 	hwif->set_dma_mode		= tmp_hwif->set_dma_mode;
 	hwif->mdma_filter		= tmp_hwif->mdma_filter;
@@ -660,11 +662,11 @@
 }
 
 /**
- *	ide_register_hw_with_fixup	-	register IDE interface
+ *	ide_register_hw		-	register IDE interface
  *	@hw: hardware registers
+ *	@fixup: fixup function
  *	@initializing: set while initializing built-in drivers
  *	@hwifp: pointer to returned hwif
- *	@fixup: fixup function
  *
  *	Register an IDE interface, specifying exactly the registers etc.
  *	Set init=1 iff calling before probes have taken place.
@@ -672,9 +674,8 @@
  *	Returns -1 on error.
  */
 
-int ide_register_hw_with_fixup(hw_regs_t *hw, int initializing,
-			       ide_hwif_t **hwifp,
-			       void(*fixup)(ide_hwif_t *hwif))
+int ide_register_hw(hw_regs_t *hw, void (*fixup)(ide_hwif_t *),
+		    int initializing, ide_hwif_t **hwifp)
 {
 	int index, retry = 1;
 	ide_hwif_t *hwif;
@@ -710,11 +711,12 @@
 	memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
 	hwif->irq = hw->irq;
 	hwif->noprobe = 0;
+	hwif->fixup = fixup;
 	hwif->chipset = hw->chipset;
 	hwif->gendev.parent = hw->dev;
 
 	if (!initializing) {
-		probe_hwif_init_with_fixup(hwif, fixup);
+		probe_hwif_init(hwif);
 		ide_proc_register_port(hwif);
 	}
 
@@ -724,13 +726,6 @@
 	return (initializing || hwif->present) ? index : -1;
 }
 
-EXPORT_SYMBOL(ide_register_hw_with_fixup);
-
-int ide_register_hw(hw_regs_t *hw, int initializing, ide_hwif_t **hwifp)
-{
-	return ide_register_hw_with_fixup(hw, initializing, hwifp, NULL);
-}
-
 EXPORT_SYMBOL(ide_register_hw);
 
 /*
@@ -1046,7 +1041,7 @@
 			ide_init_hwif_ports(&hw, (unsigned long) args[0],
 					    (unsigned long) args[1], NULL);
 			hw.irq = args[2];
-			if (ide_register_hw(&hw, 0, NULL) == -1)
+			if (ide_register_hw(&hw, NULL, 0, NULL) == -1)
 				return -EIO;
 			return 0;
 		}