diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:05 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:05 -0500 |
commit | 57c802e84f9c759c3d1794a9dbe81bc10444df62 (patch) | |
tree | e8774704b3394b12efbb787022cc11b48a13dec0 /drivers/ide/ide.c | |
parent | 8f8e8483f667d79739007b25f0e59a540fb9fa51 (diff) |
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 <rmk@arm.linux.org.uk>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Jeremy Higdon <jeremy@sgi.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 8ef521f66f87..98bd45e8c175 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -675,6 +675,17 @@ void ide_setup_ports ( hw_regs_t *hw, | |||
675 | */ | 675 | */ |
676 | } | 676 | } |
677 | 677 | ||
678 | void ide_init_port_hw(ide_hwif_t *hwif, hw_regs_t *hw) | ||
679 | { | ||
680 | memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); | ||
681 | hwif->irq = hw->irq; | ||
682 | hwif->noprobe = 0; | ||
683 | hwif->chipset = hw->chipset; | ||
684 | hwif->gendev.parent = hw->dev; | ||
685 | hwif->ack_intr = hw->ack_intr; | ||
686 | } | ||
687 | EXPORT_SYMBOL_GPL(ide_init_port_hw); | ||
688 | |||
678 | /** | 689 | /** |
679 | * ide_register_hw - register IDE interface | 690 | * ide_register_hw - register IDE interface |
680 | * @hw: hardware registers | 691 | * @hw: hardware registers |
@@ -729,13 +740,9 @@ found: | |||
729 | } | 740 | } |
730 | if (hwif->present) | 741 | if (hwif->present) |
731 | return -1; | 742 | return -1; |
732 | memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports)); | 743 | |
733 | hwif->irq = hw->irq; | 744 | ide_init_port_hw(hwif, hw); |
734 | hwif->noprobe = 0; | ||
735 | hwif->quirkproc = quirkproc; | 745 | hwif->quirkproc = quirkproc; |
736 | hwif->chipset = hw->chipset; | ||
737 | hwif->gendev.parent = hw->dev; | ||
738 | hwif->ack_intr = hw->ack_intr; | ||
739 | 746 | ||
740 | if (initializing == 0) { | 747 | if (initializing == 0) { |
741 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; | 748 | u8 idx[4] = { index, 0xff, 0xff, 0xff }; |