From 57c802e84f9c759c3d1794a9dbe81bc10444df62 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Jan 2008 20:13:05 +0100 Subject: ide: add ide_init_port_hw() helper * Add ide_init_port_hw() helper. * rapide.c: convert rapide_locate_hwif() to rapide_setup_ports() and use ide_init_port_hw(). * ide_platform.c: convert plat_ide_locate_hwif() to plat_ide_setup_ports() and use ide_init_port_hw(). * sgiioc4.c: use ide_init_port_hw(). * pmac.c: add 'hw_regs_t *hw' argument to pmac_ide_setup_device(), setup 'hw' in pmac_ide_{macio,pci}_attach() and use ide_init_port_hw() in pmac_ide_setup_device(). This patch is a preparation for the future changes in the IDE probing code. There should be no functionality changes caused by this patch. Cc: Russell King Cc: Anton Vorontsov Cc: Jeremy Higdon Cc: Benjamin Herrenschmidt Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'drivers/ide/ide.c') diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 8ef521f66f8..98bd45e8c17 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -675,6 +675,17 @@ void ide_setup_ports ( hw_regs_t *hw, */ } +void ide_init_port_hw(ide_hwif_t *hwif, hw_regs_t *hw) +{ + memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); + hwif->irq = hw->irq; + hwif->noprobe = 0; + hwif->chipset = hw->chipset; + hwif->gendev.parent = hw->dev; + hwif->ack_intr = hw->ack_intr; +} +EXPORT_SYMBOL_GPL(ide_init_port_hw); + /** * ide_register_hw - register IDE interface * @hw: hardware registers @@ -729,13 +740,9 @@ found: } if (hwif->present) return -1; - memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); - hwif->irq = hw->irq; - hwif->noprobe = 0; + + ide_init_port_hw(hwif, hw); hwif->quirkproc = quirkproc; - hwif->chipset = hw->chipset; - hwif->gendev.parent = hw->dev; - hwif->ack_intr = hw->ack_intr; if (initializing == 0) { u8 idx[4] = { index, 0xff, 0xff, 0xff }; -- cgit v1.2.3